Initialize() 공개 메소드

Prepare the stream for reading and writing
public Initialize ( ) : void
리턴 void
예제 #1
0
 public void ConnectionTest()
 {
     var comm = new TcpClientCommunicator("127.0.0.1", 3001);
     comm.Initialize();
     Assert.IsTrue(comm.Connected);
     comm.Close();
     Assert.IsFalse(comm.Connected);
 }
예제 #2
0
 public void MessageTest()
 {
     var comm = new TcpClientCommunicator("127.0.0.1", 3001);
     comm.Initialize();
     var resp = comm.SendMessage<Response>(new GenericMessage<string>("Hello World"));
     Assert.NotNull(resp);
     Assert.IsTrue(resp.Success);
 }
예제 #3
0
 public void ResponseTest()
 {
     var comm = new TcpClientCommunicator("127.0.0.1", 3001);
     comm.Initialize();
     var msg = comm.WaitForMessage<GenericMessage<string>>();
     Assert.AreEqual(MSG, msg.Contents);
     comm.SendResponse(msg.CreateResponse(true));
     Thread.Sleep(100);
     Assert.IsTrue(Auto.RecivedResponse);
 }
예제 #4
0
 public void CallbackTest()
 {
     var comm = new TcpClientCommunicator("127.0.0.1", 3001);
     comm.Initialize();
     comm.SendMessage<Response>(new GenericMessage<string>("Hello World"), resp =>
         {
             Assert.NotNull(resp);
             Assert.IsTrue(resp.Success);
         });
     Thread.Sleep(100);
 }