Added initial implementation of handling incoming connections.