Esempio n. 1
0
 public TCPRelay(MainController controller, EndPoint localEP, EndPoint remoteEP)
 {
     _controller = controller;
     _localEP    = localEP;
     _remoteEP   = remoteEP;
     this._pipe  = new TCPPipe(this, localEP, remoteEP);
 }
Esempio n. 2
0
        public bool ConnectToDaemon(string address, int port)
        {
            if (!Enabled)
            {
                return(false);
            }

            _DaemonPipe = new TCPPipe();
            _DaemonPipe.OnDisconnected += new TCPPipe.OnDisconnectedCallback(_DaemonPipe_OnDisconnected);
            _DaemonPipe.OnReceiveLine  += new TCPPipe.OnReceiveLineCallback(_DaemonPipe_OnReceiveLine);

            SocketException se = _DaemonPipe.Connect(address, port);

            if (se == null)
            {
                return(true);
            }
            else
            {
                Console.WriteLine("Connection failed: " + se.Message);
                return(false);
            }
        }
Esempio n. 3
0
        public bool ConnectToDaemon(string address, int port)
        {
            if (!Enabled) return false;

            _DaemonPipe = new TCPPipe();
            _DaemonPipe.OnDisconnected += new TCPPipe.OnDisconnectedCallback(_DaemonPipe_OnDisconnected);
            _DaemonPipe.OnReceiveLine += new TCPPipe.OnReceiveLineCallback(_DaemonPipe_OnReceiveLine);

            SocketException se = _DaemonPipe.Connect(address, port);

            if (se == null)
            {
                return true;
            }
            else
            {
                Console.WriteLine("Connection failed: " + se.Message);
                return false;
            }
        }