Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
        private void GracefullyDisconnectInboundSocket(ZmqInboundSocket inboundSocket, MutableMemoryStream inputBuffer)
        {
            inboundSocket.Disconnect();

            while (inboundSocket.TryReceive(inputBuffer, 100.Milliseconds()))
            {
                DeserializeAndForwardTransportMessage(inputBuffer);
            }
        }
Esempio n. 3
0
        private void GracefullyDisconnectInboundSocket(ZmqInboundSocket inboundSocket)
        {
            inboundSocket.Disconnect();

            CodedInputStream inputStream;

            while ((inputStream = inboundSocket.Receive(100.Milliseconds())) != null)
            {
                DeserializeAndForwardTransportMessage(inputStream);
            }
        }
Esempio n. 4
0
        private void GracefullyDisconnectInboundSocket(ZmqInboundSocket inboundSocket)
        {
            inboundSocket.Disconnect();

            ProtoBufferReader?bufferReader;

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