Beispiel #1
0
        public void Plug(IOThread ioThread,
                         SessionBase session)
        {
            Debug.Assert(!m_plugged);
            m_plugged = true;

            //  Connect to session object.
            Debug.Assert(m_session == null);
            Debug.Assert(session != null);
            m_session = session;
            m_socket  = m_session.Socket;

            m_ioObject = new IOObject(null);
            m_ioObject.SetHandler(this);
            //  Connect to I/O threads poller object.
            m_ioObject.Plug(ioThread);
            m_ioObject.AddFd(m_handle);

            //  Send the 'length' and 'flags' fields of the identity message.
            //  The 'length' field is encoded in the long format.

            m_greetingOutputBuffer[m_outsize++] = ((byte)0xff);
            m_greetingOutputBuffer.PutLong(m_options.Endian, (long)m_options.IdentitySize + 1, 1);
            m_outsize += 8;
            m_greetingOutputBuffer[m_outsize++] = ((byte)0x7f);

            m_outpos = new ByteArraySegment(m_greetingOutputBuffer);

            m_ioObject.SetPollin(m_handle);
            m_ioObject.SetPollout(m_handle);

            //  Flush all the data that may have been already received downstream.
            InEvent();
        }
Beispiel #2
0
        public void Plug(IOThread ioThread, SessionBase session)
        {
            m_session = session;

            m_socket = session.Socket;

            m_ioObject = new IOObject(null);
            m_ioObject.SetHandler(this);
            m_ioObject.Plug(ioThread);
            m_ioObject.AddFd(m_handle);
            m_ioObject.SetPollin(m_handle);

            DropSubscriptions();

            // push message to the session because there is no identity message with pgm
            session.PushMsg(new Msg());
        }
Beispiel #3
0
        public void Plug(IOThread ioThread,
		                 SessionBase session)
        {
            Debug.Assert(!m_plugged);
            m_plugged = true;

            //  Connect to session object.
            Debug.Assert(m_session == null);
            Debug.Assert(session != null);
            m_session = session;
            m_socket = m_session.Socket;

            m_ioObject = new IOObject(null);
            m_ioObject.SetHandler(this);
            //  Connect to I/O threads poller object.
            m_ioObject.Plug(ioThread);
            m_ioObject.AddFd(m_handle);

            //  Send the 'length' and 'flags' fields of the identity message.
            //  The 'length' field is encoded in the long format.

            m_greetingOutputBuffer[m_outsize++] = ((byte) 0xff);
            m_greetingOutputBuffer.PutLong((long) m_options.IdentitySize + 1, 1);
            m_outsize += 8;
            m_greetingOutputBuffer[m_outsize++] = ((byte) 0x7f);

            m_outpos = new ByteArraySegment(m_greetingOutputBuffer);

            m_ioObject.SetPollin(m_handle);
            m_ioObject.SetPollout(m_handle);

            //  Flush all the data that may have been already received downstream.
            InEvent();
        }
Beispiel #4
0
        public void Plug(IOThread ioThread, SessionBase session)
        {
            m_session = session;

            m_socket = session.Socket;

            m_ioObject = new IOObject(null);
            m_ioObject.SetHandler(this);
            m_ioObject.Plug(ioThread);
            m_ioObject.AddFd(m_handle);
            m_ioObject.SetPollin(m_handle);

            DropSubscriptions();

            // push message to the session because there is no identity message with pgm
            session.PushMsg(new Msg());
        }