Commit 364f446c authored by Taddeüs Kroes's avatar Taddeüs Kroes

Added REUSEADDR to server socket options in exmaple code

parent 80ac440e
...@@ -69,6 +69,7 @@ Basic usage ...@@ -69,6 +69,7 @@ Basic usage
Example of an echo server (sends back what it receives): Example of an echo server (sends back what it receives):
import socket
import wspy import wspy
class EchoConnection(wspy.Connection): class EchoConnection(wspy.Connection):
...@@ -83,6 +84,7 @@ Basic usage ...@@ -83,6 +84,7 @@ Basic usage
print 'Connection closed' print 'Connection closed'
server = wspy.websocket() server = wspy.websocket()
server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
server.bind(('', 8000)) server.bind(('', 8000))
server.listen(5) server.listen(5)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment