Implemented part of the server-sided connection handling.