Hello,
SocketServer.Th readingTCPServe r accepts connections (clients can
connect) before and after it's server_forever method is called,
see below for an example.
IMHO it should only accept connections while server_forever is
running.
Kind regards,
Okko
Example, both _socket.connect calls should throw;
import SocketServer
import threading
import time
import socket
server = SocketServer.Th readingTCPServe r(("127.0.0.1" , 12345),
SocketServer.Ba seRequestHandle r)
_socket = socket.socket(s ocket.AF_INET, socket.SOCK_STR EAM)
_socket.connect (("127.0.0.1" , 12345))
def shutdown_server ():
while not server._BaseSer ver__serving:
time.sleep(0.1)
server.shutdown ()
thread = threading.Threa d(target = shutdown_server )
thread.start()
server.serve_fo rever()
thread.join()
_socket = socket.socket(s ocket.AF_INET, socket.SOCK_STR EAM)
_socket.connect (("127.0.0.1" , 12345))
SocketServer.Th readingTCPServe r accepts connections (clients can
connect) before and after it's server_forever method is called,
see below for an example.
IMHO it should only accept connections while server_forever is
running.
Kind regards,
Okko
Example, both _socket.connect calls should throw;
import SocketServer
import threading
import time
import socket
server = SocketServer.Th readingTCPServe r(("127.0.0.1" , 12345),
SocketServer.Ba seRequestHandle r)
_socket = socket.socket(s ocket.AF_INET, socket.SOCK_STR EAM)
_socket.connect (("127.0.0.1" , 12345))
def shutdown_server ():
while not server._BaseSer ver__serving:
time.sleep(0.1)
server.shutdown ()
thread = threading.Threa d(target = shutdown_server )
thread.start()
server.serve_fo rever()
thread.join()
_socket = socket.socket(s ocket.AF_INET, socket.SOCK_STR EAM)
_socket.connect (("127.0.0.1" , 12345))
Comment