private void CleanupConnection()
 {
     mConnection.ConnectionOpen   -= OnConnectionOpen;
     mConnection.MessageArrived   -= OnMessageArrived;
     mConnection.ConnectionClosed -= OnConnectionClosed;
     mConnection.ConnectionError  -= OnConnectionError;
     mConnection = null;
 }
        private TcpClientConnection <TMessage> CreateInnerConnection
            (Handshake handshakeRequest,
            Handshake handshakeResponse)
        {
            TcpClientConnection <TMessage> connection =
                new TcpClientConnection <TMessage>
                    (mClient,
                    handshakeRequest.MaxMessageSizeInBytes,
                    handshakeResponse,
                    mParser,
                    mByteArrayPool,
                    mAutoPingInterval);


            connection.ConnectionOpen   += OnConnectionOpen;
            connection.MessageArrived   += OnMessageArrived;
            connection.ConnectionClosed += OnConnectionClosed;
            connection.ConnectionError  += OnConnectionError;

            return(connection);
        }
예제 #3
0
 public Pinger(TcpClientConnection <TMessage> parent)
 {
     mParent = parent;
 }
예제 #4
0
        protected override void OpenConnection <TMessage>(IWampConnection <TMessage> connection)
        {
            TcpClientConnection <TMessage> casted = connection as TcpClientConnection <TMessage>;

            Task.Run(new Func <Task>(casted.HandleTcpClientAsync));
        }
예제 #5
0
        protected override void OpenConnection <TMessage>(RawSocketTcpClient original, IWampConnection <TMessage> connection)
        {
            TcpClientConnection <TMessage> casted = connection as TcpClientConnection <TMessage>;

            Task.Run(casted.HandleTcpClientAsync);
        }