TransportSocket: use lambdas instead of single function objects