コード例 #1
0
ファイル: ZmqTransport.cs プロジェクト: Bourl/Zebus
        private ZmqInboundSocket CreateInboundSocket(InboundProcStartSequenceState state)
        {
            ZmqInboundSocket inboundSocket = null;

            try
            {
                inboundSocket        = new ZmqInboundSocket(_context, PeerId, _configuredInboundEndPoint, _socketOptions, _environment);
                _realInboundEndPoint = inboundSocket.Bind();
                return(inboundSocket);
            }
            catch (Exception ex)
            {
                state.SetFailed(ex);
                if (inboundSocket != null)
                {
                    inboundSocket.Dispose();
                }

                return(null);
            }
            finally
            {
                state.Release();
            }
        }
コード例 #2
0
        private void GracefullyDisconnectInboundSocket(ZmqInboundSocket inboundSocket, MutableMemoryStream inputBuffer)
        {
            inboundSocket.Disconnect();

            while (inboundSocket.TryReceive(inputBuffer, 100.Milliseconds()))
            {
                DeserializeAndForwardTransportMessage(inputBuffer);
            }
        }
コード例 #3
0
        private void GracefullyDisconnectInboundSocket(ZmqInboundSocket inboundSocket)
        {
            inboundSocket.Disconnect();

            CodedInputStream inputStream;

            while ((inputStream = inboundSocket.Receive(100.Milliseconds())) != null)
            {
                DeserializeAndForwardTransportMessage(inputStream);
            }
        }
コード例 #4
0
        private void GracefullyDisconnectInboundSocket(ZmqInboundSocket inboundSocket)
        {
            inboundSocket.Disconnect();

            ProtoBufferReader?bufferReader;

            while ((bufferReader = inboundSocket.Receive(100.Milliseconds())) != null)
            {
                DeserializeAndForwardTransportMessage(bufferReader);
            }
        }