public int Listen() { Logger.Write(LogLevel.Debug, "Listening on port: {0}", config.Port); Logger.Write(LogLevel.Debug, "Listening on address: {0}", config.Address); int retval = NativeListener.Listen((ushort)config.Family, config.Address, (ushort)config.Port); //retval == 0 when no error occured if (retval == 0) { ThreadPool.QueueUserWorkItem(_ => NativeListener.ProcessLoop()); } return(retval); }
public int Listen() { Logger.Write(LogLevel.Debug, "Listening on port: {0}", config.Port); Logger.Write(LogLevel.Debug, "Listening on address: {0}", config.Address); int retval = NativeListener.Listen((ushort)config.Family, config.Address, (ushort)config.Port, (ushort)config.Permission); //retval == 0 when no error occured if (retval == 0) { new Thread(_ => NativeListener.ProcessLoop()).Start(); } return(retval); }