assigns handlers for each message type onto the connecting socket