private Func <SocketBase, Task> GetMethodByName(SocketBase socket) { return(_nameToMethod[socket.GetType()]); }