Echo server: Difference between revisions

typos in python implementaion
(socket + threading python2/3 solution)
(typos in python implementaion)
Line 1,868:
HOST = 'localhost'
PORT = 12321
SCOKET_TIMEOUTSOCKET_TIMEOUT = 30
 
# This function handles reading data sent by a client, echoing it back
Line 1,875:
# (one thread per client)
def handle_echo(client_connection, client_address):
client_connection.settimeout(SCOKET_TIMEOUTSOCKET_TIMEOUT)
try:
while True:
Line 1,915:
args = (current_connection,client_address) \
)
# daemon makes sure all threads are killed if the main server processesprocess
# gets killed
handler_thread.daemon = True
Anonymous user