Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
4795c58f
Commit
4795c58f
authored
Jan 26, 2014
by
Paul Sokolovsky
Browse files
sock-server.py: Use SO_REUSEADDR to avoid errors on quick restart.
parent
a88c30c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
examples/unix/sock-server.py
View file @
4795c58f
...
...
@@ -16,6 +16,7 @@ ai = socket.getaddrinfo("127.0.0.1", 8080)
print
(
"Bind address info:"
,
ai
)
addr
=
ai
[
0
][
4
]
s
.
setsockopt
(
socket
.
SOL_SOCKET
,
socket
.
SO_REUSEADDR
,
1
)
s
.
bind
(
addr
)
s
.
listen
(
5
)
print
(
"Listening, connect your browser to http://127.0.0.1:8080/"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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