Ejemplo n.º 1
0
        static async void HandleClient(int serverPort)
        {
            client = new FramedClient(
                            new SocketClient());

            client.Received += bs =>
                {
                    Console.WriteLine("Received: " +
                        encoding.GetString(bs.Array, bs.Offset, bs.Count));
                };
            
            await client.Connect(new IPEndPoint(IPAddress.Loopback, serverPort));
            client.SendPacket(encoding.GetBytes("Steve"));
        }
Ejemplo n.º 2
0
        static async void HandleClient(int serverPort)
        {
            client = new FramedClient(
                new SocketClient());

            client.Received.Subscribe(bs =>
            {
                Console.WriteLine("Received: " +
                                  encoding.GetString(bs.Array, bs.Offset, bs.Count));
            });

            await client.Connect(new IPEndPoint(IPAddress.Loopback, serverPort));

            client.SendPacket(encoding.GetBytes("Steve"));
        }
Ejemplo n.º 3
0
        public IObservable <Unit> Connect(IPEndPoint endPoint)
        {
            framedClient.Connect(endPoint);

            return(handshakeCompleted.AsObservable());
        }
Ejemplo n.º 4
0
 public IObservable <Unit> Connect(IPEndPoint endPoint)
 {
     return(framedClient.Connect(endPoint));
 }