Exemplo n.º 1
0
        static void Main(string[] args)
        {
            IPAddress address = Dns.GetHostAddresses("127.0.0.1")[0];
            Communicator comm = new Communicator(HandleConnected, HandleDisconnected, HandleMessageSent, HandleMessageReceived);
            comm.Connect(9250, 9250, address);
            comm.Send("Hello");
            Thread.Sleep(250);
            comm.Send("Hello2");
            Thread.Sleep(250);
            comm.Disconnect();

            comm.Connect(9250, 9250, address);
            comm.Send("Hello");
            Thread.Sleep(250);
            comm.Send("Hello2");
            Thread.Sleep(250);
            comm.Disconnect();
        }
 public CommunicatorControl()
 {
     InitializeComponent();
     comm = new Communicator(HandleConnected, HandleDisconnected, HandleMessageSent, HandleMessageReceived);
 }