Ejemplo n.º 1
0
        // We are host
        public I2CPSession(I2CPHost host, Socket socket)
        {
            Host     = host;
            MySocket = socket;

            CurrentState = new WaitProtVer(this);
            MySocket.BeginReceive(RecvBuf, 0, RecvBuf.Length, SocketFlags.None, new AsyncCallback(ReceiveCallback), this);
        }
Ejemplo n.º 2
0
        internal void Run()
        {
            if (CurrentState == null)
            {
                Terminate();
                return;
            }

            var os = CurrentState;
            var ns = CurrentState.Run();

            if (os != ns && ns != null)
            {
                ns = ns.Run();
            }
            CurrentState = ns;
        }