Ejemplo n.º 1
0
 /// <summary>
 /// Receives incoming data in a loop running in its own thread.
 /// </summary>
 /// <param name="ipEndPoint"></param>
 /// <param name="trace"></param>
 /// <exception cref="UdpSocketException">Thrown when socket cannot be bound to endpoint</exception>
 public ListenerBase(IpEndpoint ipEndPoint, ITrace trace)
 {
     _ipEndPoint  = ipEndPoint;
     _trace       = trace;
     _listener    = new UdpListener(ipEndPoint);
     _messageLoop = new MessageLoop <UdpListener>(_listener, trace, Operation, StopOperation);
 }
Ejemplo n.º 2
0
 public Client(IpEndpoint serverEndpoint, ITrace trace)
 {
     _trace         = trace;
     ServerEndpoint = serverEndpoint;
     _udpClient     = new UdpClient();
     _udpClient.Connect(serverEndpoint);
     _messageLoop = new MessageLoop <UdpClient>(_udpClient, _trace, Operation, StopOperation);
 }