optionally start asyncore loop in thread in tcp client/server start

This commit is contained in:
2015-09-12 09:13:43 +01:00
parent aee68f8c7c
commit 5ab020f8af
4 changed files with 15 additions and 55 deletions

View File

@@ -12,10 +12,10 @@ sock.bind(server_address)
while True:
print >>sys.stderr, '\nwaiting to receive message'
data, address = sock.recvfrom(4096)
print >>sys.stderr, 'received %s bytes from %s' % (len(data), address)
print >>sys.stderr, data
if data:
sent = sock.sendto(data, address)
print >>sys.stderr, 'sent %s bytes back to %s' % (sent, address)