/// <summary> /// Default constructor. /// </summary> public TcpSocketMessageBus() { _configuration = (TcpSocketMessageBusConfiguration)ConfigurationManager.GetSection("tcpSocketMessageBus"); if (_configuration == null) throw new InvalidOperationException("tcpSocketMessageBus configuration section cannot be found!"); _cancelTaskCompletionSource = new TaskCompletionSource<object>(); _listenTask = Task.Run(async () => await ListenAsync()); _clientConnections = _configuration.ClientEndpoints.Cast<TcpSocketEndpointElement>().Select(e => new ClientConnection(e)).ToArray(); }
/// <summary> /// Default constructor. /// </summary> public TcpSocketMessageBus() { _configuration = (TcpSocketMessageBusConfiguration)ConfigurationManager.GetSection("tcpSocketMessageBus"); if (_configuration == null) { throw new InvalidOperationException("tcpSocketMessageBus configuration section cannot be found!"); } _cancelTaskCompletionSource = new TaskCompletionSource <object>(); _listenTask = Task.Run(async() => await ListenAsync()); _clientConnections = _configuration.ClientEndpoints.Cast <TcpSocketEndpointElement>().Select(e => new ClientConnection(e)).ToArray(); }