コード例 #1
0
ファイル: SessionBase.cs プロジェクト: JayShelton/netmq
        public SessionBase(IOThread ioThread, bool connect,
                                             SocketBase socket, Options options, Address addr)
            : base(ioThread, options)
        {
            m_ioObject = new IOObject(ioThread);

            m_connect = connect;
            m_pipe = null;
            m_incompleteIn = false;
            m_pending = false;
            m_engine = null;
            m_socket = socket;
            m_ioThread = ioThread;
            m_hasLingerTimer = false;
            m_identitySent = false;
            m_identityReceived = false;
            m_addr = addr;

            if (options.RawSocket)
            {
                m_identitySent = true;
                m_identityReceived = true;
            }

            m_terminatingPipes = new HashSet<Pipe>();
        }
コード例 #2
0
ファイル: PgmSession.cs プロジェクト: EugenDueck/netmq
 public PgmSession(PgmSocket pgmSocket, Options options)
 {
     m_handle = pgmSocket.FD;
     m_pgmSocket = pgmSocket;
     m_options = options;
     data = new byte[Config.PgmMaxTPDU];
 }
コード例 #3
0
ファイル: PgmListener.cs プロジェクト: bubbafat/netmq
        public PgmListener(IOThread ioThread, SocketBase socket, Options options)
            : base(ioThread, options)
        {
            m_socket = socket;

            m_ioObject = new IOObject(ioThread);
        }
コード例 #4
0
ファイル: TcpListener.cs プロジェクト: hecwow/netmq
 public TcpListener(IOThread ioThread, SocketBase socket, Options options)
     : base(ioThread, options)
 {
     m_ioObject = new IOObject(ioThread);
     m_address = new TcpAddress();
     m_handle = null;
     m_socket = socket;
 }
コード例 #5
0
ファイル: Own.cs プロジェクト: JayShelton/netmq
        /// <summary> Initializes a new instance of the <see cref="Own" /> class that is running on a thread outside of 0MQ infrastructure. </summary>
        /// <param name="parent">The parent context.</param>
        /// <param name="threadId">The thread id.</param>
        /// <remarks> Note that the owner is unspecified in the constructor. It'll be assigned later on using <see cref="SetOwner"/>
        /// when the object is plugged in. </remarks>
        protected Own(Ctx parent, int threadId)
            : base(parent, threadId)
        {
            m_terminating = false;
            m_processedSeqnum = 0;
            m_owner = null;
            m_termAcks = 0;

            m_options = new Options();
        }
コード例 #6
0
 public PgmSender(IOThread ioThread, Options options, Address addr)
     : base(ioThread)
 {
     m_options = options;
     m_addr = addr;
     m_encoder = null;
     m_outBuffer = null;
     m_outBufferSize = 0;
     m_writeSize = 0;
     m_encoder = new Encoder(0, m_options.Endian);
 }
コード例 #7
0
ファイル: Own.cs プロジェクト: bubbafat/netmq
        //  The object is living within I/O thread.
        public Own(IOThread ioThread, Options options)
            : base(ioThread)
        {
            m_options = options;
            m_terminating = false;
            m_sentSeqnum = new AtomicLong(0);
            m_processedSeqnum = 0;
            m_owner = null;
            m_termAcks = 0;

            owned = new HashSet<Own>();
        }
コード例 #8
0
ファイル: Own.cs プロジェクト: bubbafat/netmq
        //  Note that the owner is unspecified in the constructor.
        //  It'll be supplied later on when the object is plugged in.
        //  The object is not living within an I/O thread. It has it's own
        //  thread outside of 0MQ infrastructure.
        public Own(Ctx parent, int tid)
            : base(parent, tid)
        {
            m_terminating = false;
            m_sentSeqnum = new AtomicLong(0);
            m_processedSeqnum = 0;
            m_owner = null;
            m_termAcks = 0;

            m_options = new Options();
            owned = new HashSet<Own>();
        }
コード例 #9
0
ファイル: TcpConnecter.cs プロジェクト: bubbafat/netmq
        public TcpConnecter(IOThread ioThread,
												SessionBase session, Options options,
												Address addr, bool delayedStart)
            : base(ioThread, options)
        {
            m_ioObject = new IOObject(ioThread);
            m_addr = addr;
            m_handle = null;
            m_handleValid = false;
            m_delayedStart = delayedStart;
            m_timerStarted = false;
            m_session = session;
            m_currentReconnectIvl = m_options.ReconnectIvl;

            Debug.Assert(m_addr != null);
            m_endpoint = m_addr.ToString();
            m_socket = session.Socket;
        }
コード例 #10
0
ファイル: Req.cs プロジェクト: GianniBortoloBossini/netmq
            public ReqSession(IOThread ioThread, bool connect,
												SocketBase socket, Options options,
												Address addr)
                : base(ioThread, connect, socket, options, addr)
            {
                m_state = State.Identity;
            }
コード例 #11
0
ファイル: StreamEngine.cs プロジェクト: oskarwkarlsson/netmq
        public StreamEngine(Socket fd, Options options, String endpoint)
        {
            m_handle = fd;
            //      inbuf = null;
            m_insize = 0;
            m_inputError = false;
            //        outbuf = null;
            m_outsize = 0;
            m_handshaking = true;
            m_session = null;
            m_options = options;
            m_plugged = false;
            m_endpoint = endpoint;
            m_socket = null;
            m_encoder = null;
            m_decoder = null;

            //  Put the socket into non-blocking mode.
            Utils.UnblockSocket(m_handle);

            //  Set the socket buffer limits for the underlying socket.
            if (m_options.SendBuffer != 0)
            {
                m_handle.SendBufferSize = m_options.SendBuffer;
            }
            if (m_options.ReceiveBuffer != 0)
            {
                m_handle.ReceiveBufferSize = m_options.ReceiveBuffer;
            }
        }
コード例 #12
0
 public RouterSession(IOThread ioThread, bool connect,
                      SocketBase socket, Options options,
                      Address addr)
     : base(ioThread, connect, socket, options, addr)
 {
 }
コード例 #13
0
ファイル: IpcListener.cs プロジェクト: bubbafat/netmq
 public IpcListener(IOThread ioThread, SocketBase socket, Options options)
     : base(ioThread, socket, options)
 {
     m_address = new IpcAddress();
 }
コード例 #14
0
ファイル: Ctx.cs プロジェクト: oskarwkarlsson/netmq
 public Endpoint(SocketBase socket, Options options)
 {
     Socket = socket;
     Options = options;
 }
コード例 #15
0
ファイル: SessionBase.cs プロジェクト: JayShelton/netmq
        public static SessionBase Create(IOThread ioThread, bool connect,
                                                                         SocketBase socket, Options options, Address addr)
        {
            SessionBase s;
            switch (options.SocketType)
            {
                case ZmqSocketType.Req:
                    s = new Req.ReqSession(ioThread, connect,
                                                                     socket, options, addr);
                    break;
                case ZmqSocketType.Dealer:
                    s = new Dealer.DealerSession(ioThread, connect,
                                                                                socket, options, addr);
                    break;
                case ZmqSocketType.Rep:
                    s = new Rep.RepSession(ioThread, connect,
                                                                    socket, options, addr);
                    break;
                case ZmqSocketType.Router:
                    s = new Router.RouterSession(ioThread, connect,
                                                                                socket, options, addr);
                    break;
                case ZmqSocketType.Pub:
                    s = new Pub.PubSession(ioThread, connect,
                                                                    socket, options, addr);
                    break;
                case ZmqSocketType.Xpub:
                    s = new XPub.XPubSession(ioThread, connect,
                                                                     socket, options, addr);
                    break;
                case ZmqSocketType.Sub:
                    s = new Sub.SubSession(ioThread, connect,
                                                                     socket, options, addr);
                    break;
                case ZmqSocketType.Xsub:
                    s = new XSub.XSubSession(ioThread, connect,
                                                                        socket, options, addr);
                    break;

                case ZmqSocketType.Push:
                    s = new Push.PushSession(ioThread, connect,
                                                                        socket, options, addr);
                    break;
                case ZmqSocketType.Pull:
                    s = new Pull.PullSession(ioThread, connect,
                                                                        socket, options, addr);
                    break;
                case ZmqSocketType.Pair:
                    s = new Pair.PairSession(ioThread, connect,
                                                                        socket, options, addr);
                    break;
                case ZmqSocketType.Stream:
                    s = new Stream.StreamSession(ioThread, connect, socket, options, addr);
                    break;
                default:
                    throw InvalidException.Create("type=" + options.SocketType);

            }
            return s;
        }
コード例 #16
0
ファイル: PgmSocket.cs プロジェクト: bubbafat/netmq
 public PgmSocket(Options options, PgmSocketType pgmSocketType, PgmAddress pgmAddress)
 {
     m_options = options;
     m_pgmSocketType = pgmSocketType;
     m_pgmAddress = pgmAddress;
 }
コード例 #17
0
ファイル: Own.cs プロジェクト: bbqchickenrobot/netmq
 /// <summary>
 /// Initializes a new instance of the <see cref="Own" /> class that is running on a thread outside of 0MQ infrastructure.
 /// </summary>
 /// <param name="parent">The parent context.</param>
 /// <param name="threadId">The thread id.</param>
 /// <remarks>
 /// Note that the owner is unspecified in the constructor. It'll be assigned later on using <see cref="SetOwner"/>
 /// when the object is plugged in.
 /// </remarks>
 protected Own([NotNull] Ctx parent, int threadId)
     : base(parent, threadId)
 {
     m_options = new Options();
 }
コード例 #18
0
ファイル: Own.cs プロジェクト: JayShelton/netmq
 /// <summary> Initializes a new instance of the <see cref="Own" /> class that is running within I/O thread. </summary>
 /// <param name="ioThread">The I/O thread.</param>
 /// <param name="options">The options.</param>
 /// <remarks> Note that the owner is unspecified in the constructor. It'll be assigned later on using <see cref="SetOwner"/>
 /// when the object is plugged in. </remarks>
 protected Own(IOThread ioThread, Options options)
     : base(ioThread)
 {
     m_options = options;
     m_terminating = false;
     m_processedSeqnum = 0;
     m_owner = null;
     m_termAcks = 0;
 }
コード例 #19
0
ファイル: Pair.cs プロジェクト: GianniBortoloBossini/netmq
            public PairSession(IOThread ioThread, bool connect,
			                   SocketBase socket, Options options,
			                   Address addr)
                : base(ioThread, connect, socket, options, addr)
            {
            }
コード例 #20
0
ファイル: Own.cs プロジェクト: bbqchickenrobot/netmq
 /// <summary>
 /// Initializes a new instance of the <see cref="Own" /> class that is running within I/O thread.
 /// </summary>
 /// <param name="ioThread">The I/O thread.</param>
 /// <param name="options">The options.</param>
 /// <remarks>
 /// Note that the owner is unspecified in the constructor. It'll be assigned later on using <see cref="SetOwner"/>
 /// when the object is plugged in.
 /// </remarks>
 protected Own([NotNull] IOThread ioThread, [NotNull] Options options)
     : base(ioThread)
 {
     m_options = options;
 }