public bool Start(IPAddress ip, int port, ISlavePeerListener listener) { listener_ = listener; EndPoint = new IPEndPoint(ip, port); try { tcpListener_ = new TcpListener(EndPoint); tcpListener_.Start(1); tcpListener_.BeginAcceptSocket(AcceptCallback, tcpListener_); } catch (SocketException) { return false; } return true; }
public bool Start(IPAddress ip, int port, ISlavePeerListener listener) { listener_ = listener; EndPoint = new IPEndPoint(ip, port); try { tcpListener_ = new TcpListener(EndPoint); tcpListener_.Start(1); tcpListener_.BeginAcceptSocket(AcceptCallback, tcpListener_); } catch (SocketException) { return(false); } return(true); }