functor to bind callback to tcpserver