Ejemplo n.º 1
0
        public void TestServerLogger()
        {
            SendSocket s = new SendSocket();
            s.Connect(serverIp, serverPort, localPort);
            s.Send("HELLO WORLD!");
            s.Send("CAN YOU HEAR ME?");

            System.Threading.Thread.Sleep(4000);

            s.Send("HELLO..?");
        }
Ejemplo n.º 2
0
        public void TestReadTask()
        {
            SendSocket sSock = new SendSocket();
            sSock.Connect(localhost, recvPort, sendPort);

            RecvSocket rSock = new RecvSocket();
            rSock.Connect(recvPort);
            rSock.BeginRead();

            for(int i = 0; i < 10; ++i)
            {
                System.Threading.Thread.Sleep(1000);
                SendString(sSock,String.Format("{0} : Hello World", i));
            }
        }
Ejemplo n.º 3
0
        public void TestStopRead()
        {
            SendSocket sSock = new SendSocket();
            sSock.Connect(localhost, recvPort, sendPort);

            RecvSocket rSock = new RecvSocket();
            rSock.Connect(recvPort);
            rSock.BeginRead();

            for(int i = 1; i < 11; ++i)
            {
                System.Threading.Thread.Sleep(1000);
                // kill read half way through
                if(i % 5 == 0)
                {
                    rSock.EndRead();
                }
                SendString(sSock, String.Format("{0} : Hello World", i));
            }
        }