private static SocketAwaitable ConnectAsync(Socket socket, SocketAsyncEventArgs args, EndPoint endpoint) { args.RemoteEndPoint = endpoint; if (!socket.ConnectAsync(args)) { SocketAwaitable.OnCompleted(args); } return(GetAwaitable(args)); }