コード例 #1
0
ファイル: SignalsClient.cs プロジェクト: Mokarski/Vagonka
        private void IsChannelReady()
        {
            if (mRpcController.Channel != null && mRpcController.Channel.IsReady)
            {
                return;
            }

            try
            {
                mTcpClient = new TcpClient(mUrl, Settings.Port)
                {
                    SendTimeout = 3000
                };

                mRpcChannel = new TcpClientRpcChannel(mRpcController, mTcpClient, Timeout.Infinite)//, "client")
                {
                    OnError = () =>
                    {
                        Console.WriteLine("-- client f**k");
                        if (mTcpClient != null)
                        {
                            mTcpClient.Close();
                        }

                        if (OnError != null)
                        {
                            OnError();
                        }
                    }
                };
                mRpcChannel.Start();
            }
            catch (SocketException) {}
        }
コード例 #2
0
 public Server(ClusterConfiguration clusterConfiguration)
 {
     _currentStatus = new UninitializedStatus(this);
     _statusFactory = new StatusFactory();
     // todo avoid hard-coded timespan
     _rpcChannel = new NetMqRpcChannel(clusterConfiguration, TimeSpan.FromMilliseconds(200));
 }
コード例 #3
0
 public NamedPipeTransportChannel(RpcChannel <NamedPipeTransportChannel> channel, PipeStream pipeStream)
 {
     Channel     = channel ?? throw new ArgumentNullException(nameof(channel));
     _pipeStream = pipeStream ?? throw new ArgumentNullException(nameof(pipeStream));
 }
コード例 #4
0
 public TcpTransportChannel(RpcChannel <TcpTransportChannel> channel, TcpClient client)
 {
     Channel = channel ?? throw new ArgumentNullException(nameof(channel));
     Client  = client ?? throw new System.ArgumentNullException(nameof(client));
 }