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..?"); }
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)); } }
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)); } }