lyokato/ocean-core — pull request #3 by jfsso (2012-09-27 02:03:44+00:00)
Title: Write all remaining buffer before closing socket

I had a problem that the buffer was not completely flushed before closing the socket when implementing stateless protocols on Ocean.

I fixed it by using AnyEvent's push_shutdown but I also seen some references to it being commented-out. I'm curious if there was any specific reason to not use push_shutdown and closing the socket directly.

--- commit message
- Socket was being closed before the remaining buffer was flushed.
- For xmpp sockets this wouldn't be a problem as the server rarely closes a connection.
- But it would close the connection before sending all the response for stateless protocols (ie. HTTP).