Beispiel #1
0
        // Token: 0x060008F1 RID: 2289 RVA: 0x0001E328 File Offset: 0x0001C528
        public void BeginConnect(EndPoint remoteEndPoint)
        {
            if (this.PipeLineProcessor == null)
            {
                throw new Exception("This client has not been initialized.");
            }
            TcpClientSession underlyingSession = this.GetUnderlyingSession();
            EndPoint         endPointToBind    = this.m_EndPointToBind;

            if (endPointToBind != null)
            {
                underlyingSession.LocalEndPoint = endPointToBind;
            }
            underlyingSession.NoDelay = this.NoDelay;
            if (this.Proxy != null)
            {
                underlyingSession.Proxy = this.Proxy;
            }
            underlyingSession.Connected    += this.OnSessionConnected;
            underlyingSession.Error        += this.OnSessionError;
            underlyingSession.Closed       += this.OnSessionClosed;
            underlyingSession.DataReceived += this.OnSessionDataReceived;
            if (this.ReceiveBufferSize > 0)
            {
                underlyingSession.ReceiveBufferSize = this.ReceiveBufferSize;
            }
            this.m_Session = underlyingSession;
            underlyingSession.Connect(remoteEndPoint);
        }
        private void OnSessionConnected(object sender, EventArgs e)
        {
            m_Connected = true;
            TcpClientSession tcpClientSession = sender as TcpClientSession;

            if (tcpClientSession != null)
            {
                m_LocalEndPoint = tcpClientSession.LocalEndPoint;
            }
            m_ConnectEvent.Set();
            this.Connected?.Invoke(this, EventArgs.Empty);
        }
Beispiel #3
0
        // Token: 0x060008FF RID: 2303 RVA: 0x0001E6CC File Offset: 0x0001C8CC
        private void OnSessionConnected(object sender, EventArgs e)
        {
            this.m_Connected = true;
            TcpClientSession tcpClientSession = sender as TcpClientSession;

            if (tcpClientSession != null)
            {
                this.m_LocalEndPoint = tcpClientSession.LocalEndPoint;
            }
            this.m_ConnectEvent.Set();
            EventHandler connected = this.Connected;

            if (connected != null)
            {
                connected(this, EventArgs.Empty);
            }
        }