Czesc. mamy prosty kod serwera:
port = 80
server = socket.socket( socket.AF_INET, socket.SOCK_STREAM )
server.bind(( '10.156.236.209', port ))
server.listen( 5 )
print 'Server running on port %d' % port
while 1:
( client, a ) = server.accept()
message = client.recv( 256 )
regex = re.compile( r'.*\+.*\+.*' )
match = regex.findall( message )
print 'Incomming message: %s ' % message
if len( match ):
try:
thread = threading.Thread( target = UpdateUser, args = [ message ] ) #w nowym watku zapisuje do bazy dane z wiadomosci
thread.start()
except Exception, e:
pass
Nie wiem czemu, ten kod po jakims czasie poprawnego dzialania (byc moze z powodu duzej ilosci klientow) wyrzuca wyjątek
socket.error: [Errno 10053] An established connection was aborted by the software in your host machine
Co moze byc nie tak?