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);
        }
 public Pinger(TcpClientConnection <TMessage> parent)
 {
     mParent = parent;
 }
Example #4
0
        protected override void OpenConnection <TMessage>(IWampConnection <TMessage> connection)
        {
            TcpClientConnection <TMessage> casted = connection as TcpClientConnection <TMessage>;

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

            Task.Run(casted.HandleTcpClientAsync);
        }