コード例 #1
0
        /// <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();
        }
コード例 #2
0
        /// <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();
        }