Пример #1
0
 public GameSocketPair(DuplexStream serverStream, DuplexStream clientStream, GameSocket clientSocket, GameSocket serverSocket)
 {
     ClientStream = clientStream;
     ServerStream = serverStream;
     ClientSocket = clientSocket;
     ServerSocket = serverSocket;
 }
Пример #2
0
        public static GameSocketPair Create()
        {
            // Create streams
            var serverStream = new DuplexStream();
            var clientStream = serverStream.CreateReverseDuplexStream();

            return(new GameSocketPair(
                       serverStream,
                       clientStream,
                       clientSocket: GameSocket.CreateFromStream(clientStream, isServer: false, subProtocol: null, keepAliveInterval: TimeSpan.FromMinutes(2)),
                       serverSocket: GameSocket.CreateFromStream(serverStream, isServer: true, subProtocol: null, keepAliveInterval: TimeSpan.FromMinutes(2))));
        }