Wrote an event-based socket server.