Esempio n. 1
0
        public ProxyBlockWeb(string _peerId, string peerHost, int peerPort, PeerManager pm)
        {
            peerAddress = string.Format("{0}:{1}", peerHost, peerPort);
            peerId = _peerId;

            peerManager = pm;

            peerManager.PeerDisconnected += new PeerConnectDelegate(peerManager_PeerDisconnected);
        }
Esempio n. 2
0
        private void startServer()
        {
            peerManager = new PeerManager(this.myId, new PeerLogDelegate(intLogEvent));

            peerManager.SetHandler(MsgCode.CallBlockWebMethod, new MessageHandlerDelegate(onCallWebMethodRequest));
            peerManager.SetHandler(MsgCode.CallBlockMethod, new MessageHandlerDelegate(onCallBlockMethodRequest));

            peerManager.PeerDisconnected += new PeerConnectDelegate(peerManager_PeerDisconnected);
            peerManager.PeerConnected += new PeerConnectDelegate(peerManager_PeerDisconnected);
        }
Esempio n. 3
0
        public virtual void Dispose()
        {
            if (peerManager != null)
            {
                peerManager.Disconnect();
                peerManager.Dispose();
                peerManager = null;
            }

            //also dispose all blocks
            foreach (IContainerBlock block in innerBlocks.Values)
            {
                block.Dispose();
            }
        }