public TCPRelay(MainController controller, EndPoint localEP, EndPoint remoteEP) { _controller = controller; _localEP = localEP; _remoteEP = remoteEP; this._pipe = new TCPPipe(this, localEP, remoteEP); }
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); } }
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; } }