Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5336f8ca
Commit
5336f8ca
authored
Jul 15, 2004
by
Andrew M. Kuchling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Patch #982681] Apply this patch correctly; makes set_reuse_addr() work on Windows
parent
7323f084
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Lib/asyncore.py
Lib/asyncore.py
+9
-3
No files found.
Lib/asyncore.py
View file @
5336f8ca
...
@@ -263,14 +263,20 @@ class dispatcher:
...
@@ -263,14 +263,20 @@ class dispatcher:
def
set_reuse_addr
(
self
):
def
set_reuse_addr
(
self
):
# try to re-use a server port if possible
# try to re-use a server port if possible
try
:
try
:
# Windows SO_REUSEADDR is very broken (from a unixy perspective)
if
sys
.
platform
==
'win32'
:
reuse_constant
=
socket
.
SO_EXCLUSIVEADDRUSE
else
:
reuse_constant
=
socket
.
SO_REUSEADDR
self
.
socket
.
setsockopt
(
self
.
socket
.
setsockopt
(
socket
.
SOL_SOCKET
,
socket
.
SO_REUSEADDR
,
socket
.
SOL_SOCKET
,
reuse_constant
,
self
.
socket
.
getsockopt
(
socket
.
SOL_SOCKET
,
self
.
socket
.
getsockopt
(
socket
.
SOL_SOCKET
,
socket
.
SO_REUSEADDR
)
|
1
reuse_constant
)
|
1
)
)
except
socket
.
error
:
except
socket
.
error
:
pass
pass
# ==================================================
# ==================================================
# predicates for select()
# predicates for select()
# these are used as filters for the lists of sockets
# these are used as filters for the lists of sockets
...
...
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