Added missing assignment of connection->data=server;
Switched the order of checking the events in process_connection_event:
first a message, since it can set the event when a messagesize is zero.
This indicates the hangup of connection with inet connections.