Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
58b030c2
Commit
58b030c2
authored
Nov 03, 2007
by
Kai Blin
Committed by
Alexandre Julliard
Nov 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Map SO_REUSEADDR.
BSD socket SO_REUSEADDR is not a complete match, but features like "allow binding to a port immediately after closing it" seem to be compatible.
parent
bb4ba8e2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
19 deletions
+5
-19
socket.c
dlls/ws2_32/socket.c
+5
-19
No files found.
dlls/ws2_32/socket.c
View file @
58b030c2
...
...
@@ -1654,6 +1654,7 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
case
WS_SO_KEEPALIVE
:
case
WS_SO_OOBINLINE
:
case
WS_SO_RCVBUF
:
case
WS_SO_REUSEADDR
:
case
WS_SO_SNDBUF
:
case
WS_SO_TYPE
:
if
(
(
fd
=
get_sock_fd
(
s
,
0
,
NULL
))
==
-
1
)
...
...
@@ -1796,18 +1797,6 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level,
return
ret
;
}
#endif
/* As mentioned in setsockopt, the windows style SO_REUSEADDR is
* not possible in Unix, so always return false here. */
case
WS_SO_REUSEADDR
:
if
(
!
optlen
||
*
optlen
<
sizeof
(
int
)
||
!
optval
)
{
SetLastError
(
WSAEFAULT
);
return
SOCKET_ERROR
;
}
*
(
int
*
)
optval
=
0
;
*
optlen
=
sizeof
(
int
);
return
0
;
default:
TRACE
(
"Unknown SOL_SOCKET optname: 0x%08x
\n
"
,
optname
);
SetLastError
(
WSAENOPROTOOPT
);
...
...
@@ -2869,6 +2858,10 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
case
WS_SO_ERROR
:
case
WS_SO_KEEPALIVE
:
case
WS_SO_OOBINLINE
:
/* BSD socket SO_REUSEADDR is not 100% compatible to winsock semantics.
* however, using it the BSD way fixes bug 8513 and seems to be what
* most programmers assume, anyway */
case
WS_SO_REUSEADDR
:
case
WS_SO_SNDBUF
:
case
WS_SO_TYPE
:
convert_sockopt
(
&
level
,
&
optname
);
...
...
@@ -2902,13 +2895,6 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
TRACE
(
"setting global SO_OPENTYPE = 0x%x
\n
"
,
*
((
int
*
)
optval
)
);
return
0
;
/* SO_REUSEADDR allows two applications to bind to the same port at at
* same time. There is no direct way to do that in unix. While Wineserver
* might do this, it does not seem useful for now, so just ignore it.*/
case
WS_SO_REUSEADDR
:
TRACE
(
"Ignoring SO_REUSEADDR, does not translate
\n
"
);
return
0
;
#ifdef SO_RCVTIMEO
case
WS_SO_RCVTIMEO
:
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment