Ejemplo n.º 1
0
 static void Main(string[] args)
 {
     using (AsyncDevice ar = new AsyncDevice("inproc://server", "inproc://asyncReturn", AsyncReturn)) {
         using (Socket clientA = new Socket(SocketType.REQ),
             clientB = new Socket(SocketType.REQ)) {
             ar.Start();
             System.Threading.Thread.Sleep(1000);
             clientA.Connect("inproc://server");
             clientB.Connect("inproc://server");
             clientA.Send("Hello from A", Encoding.Unicode);
             clientB.Send("Hello from B", Encoding.Unicode);
             Console.WriteLine(clientA.Recv(Encoding.Unicode));
             Console.WriteLine(clientB.Recv(Encoding.Unicode));
             Console.ReadLine();
         }
     }
 }
Ejemplo n.º 2
0
 static void Main(string[] args)
 {
     using (AsyncDevice ar = new AsyncDevice("inproc://server", "inproc://asyncReturn", AsyncReturn)) {
         using (Socket clientA = new Socket(SocketType.REQ),
                clientB = new Socket(SocketType.REQ)) {
             ar.Start();
             System.Threading.Thread.Sleep(1000);
             clientA.Connect("inproc://server");
             clientB.Connect("inproc://server");
             clientA.Send("Hello from A", Encoding.Unicode);
             clientB.Send("Hello from B", Encoding.Unicode);
             Console.WriteLine(clientA.Recv(Encoding.Unicode));
             Console.WriteLine(clientB.Recv(Encoding.Unicode));
             Console.ReadLine();
         }
     }
 }