BF: asyncserver now ensures all data is sent

Previously was using `send` method, which uses `socket.send`. This does
not guarantee to send all data, and no check was in place to verify
whether all data was sent. Using asynchat built in `push` method,
ensures that all data is sent before closing the connection.
pull/532/head
Steven Hiscocks 2013-12-28 18:42:03 +00:00
parent 33df269d82
commit 4d128db64a
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ class RequestHandler(asynchat.async_chat):
# Serializes the response.
message = dumps(message, HIGHEST_PROTOCOL)
# Sends the response to the client.
self.send(message + RequestHandler.END_STRING)
self.push(message + RequestHandler.END_STRING)
# Closes the channel.
self.close_when_done()