Ejemplo n.º 1
0
        public override bool Start()
        {
            _peer = Peer.CreateServer(Ip, Port, 1024);
            if (_peer == null)
            {
                return(false);
            }

            write = new StreamWrite(this, _peer);
            read  = new StreamRead(this, _peer);
            return(true);
        }
Ejemplo n.º 2
0
        public override bool Connect(string strUrl, int port)
        {
            base.Connect(strUrl, port);
            _peer = Peer.CreateConnection(strUrl, port, 12, 400, 0);
            if (_peer == null)
            {
                return(false);
            }

            write            = new StreamWrite(this, _peer);
            read             = new StreamRead(this, _peer);
            ConnectedAddress = strUrl;
            ConnectedPort    = port;
            ServerName       = "";
            Connection       = new Connection();
            return(true);
        }