private static void SendReceive(PairSocket s) { NanomsgSocketOptions.SetTimespan(s.SocketID, SocketOptionLevel.Default, SocketOption.RCVTIMEO, TimeSpan.FromMilliseconds(100)); while (true) { var data = s.Receive(); if (data != null) { Console.WriteLine("RECEIVED: '" + Encoding.UTF8.GetString(data) + "'"); } Thread.Sleep(TimeSpan.FromSeconds(1)); s.Send(Encoding.UTF8.GetBytes("the message is " + DateTime.Now.ToLongTimeString())); } }
public void Receive(ref Msg msg, SendReceiveOptions options) { m_self.Receive(ref msg, options); }
public byte[] Receive(bool dontWait, out bool hasMore) { return(self.Receive(dontWait, out hasMore)); }
public void Receive(ref Msg msg, SendReceiveOptions options) { m_messagesPipe.Receive(ref msg, options); }
public void Receive(ref Msg msg) { m_messagesPipe.Receive(ref msg); }