Beispiel #1
0
 public Receiver(IPEndPoint endpoint, IReceivingProtocol protocol, IStreamSecurity security, ILogger logger)
 {
     Endpoint  = endpoint;
     _localUri = new Uri($"lq://localhost:{Endpoint.Port}");
     Timeout   = TimeSpan.FromSeconds(5);
     _protocol = protocol;
     _security = security;
     _logger   = logger;
     _listener = new TcpListener(Endpoint);
     _listener.Server.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
     _lockObject = new object();
 }
Beispiel #2
0
 private void InitializeDefaults()
 {
     _sendingProtocol   = _sendingProtocol ?? new SendingProtocol(_store, _logger);
     _receivingProtocol = _receivingProtocol ?? new ReceivingProtocol(_store, _logger);
     _scheduler         = _scheduler ?? TaskPoolScheduler.Default;
 }
Beispiel #3
0
 public QueueConfiguration CommunicateWithProtocol(IReceivingProtocol receivingProtocol, ISendingProtocol sendingProtocol)
 {
     _receivingProtocol = receivingProtocol;
     _sendingProtocol   = sendingProtocol;
     return(this);
 }