public bool Listen(int port) { EndListen(); asyncListener = new AsyncListener(port); asyncListener.Accept += AsyncListener_Accept; asyncListener.Start(); return(true); }
public bool Listen(int port) { EndListen(); try { asyncListener = new AsyncListener(port); asyncListener.Accept += AsyncListener_Accept; asyncListener.Start(); } catch (SocketException) { asyncListener = null; return(false); } return(true); }