Пример #1
0
        public WsServerPeer(WsService session)
        {
            serviceForPeer = session;

            serviceForPeer.OnOpenEvent  += () => { _isConnected = true; };
            serviceForPeer.OnCloseEvent += (msg) => { _isConnected = false; };
            serviceForPeer.OnErrorEvent += (msg) => { _isConnected = false; };

            //_delayedMessages = new Queue<byte[]>();

            _isConnected = true;
        }
Пример #2
0
        public WsServerPeer(WsService session)
        {
            _session = session;

            _session.OnOpenEvent  += () => { _isConnected = true; };
            _session.OnCloseEvent += (msg) => { _isConnected = false; };
            _session.OnErrorEvent += (msg) => { _isConnected = false; };

            _delayedMessages = new Queue <byte[]>();

            // When we're creating a peer in server, it's considered that there's
            // already a connection for which we're making it.
            _isConnected = true;
        }