Exemple #1
0
 /// <summary>
 /// stop consuming/receiving data
 /// </summary>
 /// <returns></returns>
 public bool StopConsuming()
 {
     try
     {
         Client.Close();
         Client    = null;
         Consumer  = null;
         Consuming = false;
         return(true);
     }
     catch (Exception ex)
     {
         Trace.WriteLine(ex.ToString());
     }
     return(false);
 }
Exemple #2
0
 /// <summary>
 /// stop consuming/receiving data
 /// </summary>
 /// <returns></returns>
 public bool StopConsuming()
 {
     try
     {
         Client.Close();
         Client = null;
         Consumer = null;
         Consuming = false;
         return true;
     }
     catch(Exception ex)
     {
         Trace.WriteLine(ex.ToString());
     }
     return false;
 }
Exemple #3
0
 /// <summary>
 /// start conuming/recieving data
 /// </summary>
 /// <param name="port"></param>
 /// <param name="consumer"></param>
 /// <returns></returns>
 public bool StartConsuming(int port, INetComConsumer consumer)
 {
     try
     {
         Consumer            = consumer;
         Client              = new UdpClient(port);
         Client.DontFragment = true;
         Client.BeginReceive(new AsyncCallback(ReceivePacket), null);
         Consuming = true;
         return(true);
     }
     catch (Exception ex)
     {
         Trace.WriteLine(ex.ToString());
     }
     return(false);
 }
Exemple #4
0
 /// <summary>
 /// start conuming/recieving data
 /// </summary>
 /// <param name="port"></param>
 /// <param name="consumer"></param>
 /// <returns></returns>
 public bool StartConsuming(int port, INetComConsumer consumer)
 {
     try
     {
         Consumer = consumer;
         Client = new UdpClient(port);
         Client.DontFragment = true;
         Client.BeginReceive(new AsyncCallback(ReceivePacket), null);
         Consuming = true;
         return true;
     }
     catch (Exception ex)
     {
         Trace.WriteLine(ex.ToString());
     }
     return false;
 }
Exemple #5
0
 /// <summary>
 /// start conuming/recieving data
 /// </summary>
 /// <param name="port"></param>
 /// <param name="consumer"></param>
 /// <returns></returns>
 public bool StartConsuming(int port, INetComConsumer consumer)
 {
     //try
     //{
     //    Consumer = consumer;
     //    Client = new TcpClient(port);
     //    Client.DontFragment = true;
     //    Client.BeginReceive(new AsyncCallback(ReceivePacket), null);
     //    Consuming = true;
     //    return true;
     //}
     //catch (Exception ex)
     //{
     //    Trace.WriteLine(ex.ToString());
     //}
     return(false);
 }
Exemple #6
0
 /// <summary>
 /// start conuming/recieving data
 /// </summary>
 /// <param name="port"></param>
 /// <param name="consumer"></param>
 /// <returns></returns>
 public bool StartConsuming(int port, INetComConsumer consumer)
 {
     //try
     //{
     //    Consumer = consumer;
     //    Client = new TcpClient(port);
     //    Client.DontFragment = true;
     //    Client.BeginReceive(new AsyncCallback(ReceivePacket), null);
     //    Consuming = true;
     //    return true;
     //}
     //catch (Exception ex)
     //{
     //    Trace.WriteLine(ex.ToString());
     //}
     return false;
 }
Exemple #7
0
 public bool StartConsuming(int port, INetComConsumer consumer)
 {
     try
     {
         if (Consuming)
             return false;
         eventStop.Reset();
         PortSubscribe = port;
         threadMessaging = new Thread(new ThreadStart(ZMQReceiver));
         threadMessaging.Start();
         Consuming = true;
         return true;
     }
     catch (System.Exception ex)
     {
         Trace.WriteLine(ex.ToString());
     }
     return false;
 }
Exemple #8
0
 public bool StartConsuming(int port, INetComConsumer consumer)
 {
     try
     {
         if (Consuming)
         {
             return(false);
         }
         eventStop.Reset();
         PortSubscribe   = port;
         threadMessaging = new Thread(new ThreadStart(ZMQReceiver));
         threadMessaging.Start();
         Consuming = true;
         return(true);
     }
     catch (System.Exception ex)
     {
         Trace.WriteLine(ex.ToString());
     }
     return(false);
 }
Exemple #9
0
 public bool StartConsuming(INetComConsumer consumer)
 {
     return StartConsuming(PortSubscribe, consumer);
 }
Exemple #10
0
 /// <summary>
 /// start consuming/receiving data with internal port
 /// </summary>
 /// <param name="consumer"></param>
 /// <returns></returns>
 public bool StartConsuming(INetComConsumer consumer)
 {
     return(StartConsuming(PortIn, consumer));
 }
Exemple #11
0
 public bool StartConsuming(INetComConsumer consumer)
 {
     return(StartConsuming(PortSubscribe, consumer));
 }
Exemple #12
0
 /// <summary>
 /// start consuming/receiving data with internal port
 /// </summary>
 /// <param name="consumer"></param>
 /// <returns></returns>
 public bool StartConsuming(INetComConsumer consumer)
 {
     return StartConsuming(PortIn, consumer);
 }