예제 #1
0
 protected override void ProcessPlug()
 {
     //  Start polling for incoming connections.
     m_ioObject.SetHandler(this);
     m_ioObject.AddFd(m_handle);
     m_ioObject.SetPollin(m_handle);
 }
예제 #2
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();
        }
예제 #3
0
 protected override void ProcessPlug()
 {
     m_ioObject.SetHandler(this);
     if (m_connect)
     {
         StartConnecting(false);
     }
 }
예제 #4
0
 protected override void ProcessPlug()
 {
     m_ioObject.SetHandler(this);
     if (m_delayedStart)
     {
         AddReconnectTimer();
     }
     else
     {
         StartConnecting();
     }
 }
예제 #5
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());
        }
예제 #6
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();
        }
예제 #7
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());
        }