A generic server interface that allows us to mock the server's behavior in tests.
Register a function to be called when a new socket connects. This should be only called once per server.
A generic server interface that allows us to mock the server's behavior in tests.