public NpcBlockingThreadHander(String clientString, INpcServerCallback callback, Socket socket, NpcExecutor npcExecutor, INpcHtmlGenerator npcHtmlGenerator) : base(clientString, callback, npcExecutor, npcHtmlGenerator) { this.socket = socket; this.socketLineReader = new SocketLineReader(socket, Encoding.ASCII, Buf.DefaultInitialCapacity, Buf.DefaultExpandLength); }
public NpcServerSingleThreaded(INpcServerCallback callback, NpcExecutor npcExecutor, INpcHtmlGenerator htmlGenerator, UInt16 port) { if (callback == null) { throw new ArgumentNullException("callback"); } if (npcExecutor == null) { throw new ArgumentNullException("npcExecutor"); } if (htmlGenerator == null) { throw new ArgumentNullException("htmlGenerator"); } this.callback = callback; this.npcExecutor = npcExecutor; this.htmlGenerator = htmlGenerator; Socket listenSocket = new Socket(IPAddress.Any.AddressFamily, SocketType.Stream, ProtocolType.Tcp); listenSocket.Bind(new IPEndPoint(IPAddress.Any, port)); listenSocket.Listen(Backlog); callback.ServerListening(listenSocket); selectServer = new SelectServer(false, new Buf(SingleThreadedReceiveBufferLength)); selectServer.control.AddListenSocket(listenSocket, AcceptCallback); }
public NpcSocketHandler(String clientString, INpcServerCallback callback, NpcExecutor npcExecutor, INpcHtmlGenerator npcHtmlGenerator) : base(clientString, callback, npcExecutor, npcHtmlGenerator) { if (callback == null) { throw new ArgumentNullException("callback"); } this.lineParser = new LineParser(Encoding.ASCII, Buf.DefaultInitialCapacity, Buf.DefaultExpandLength); }
public NpcSelectServerHandler(INpcServerCallback callback, NpcExecutor npcExecutor, INpcHtmlGenerator htmlGenerator) { if (callback == null) { throw new ArgumentNullException("callback"); } if (npcExecutor == null) { throw new ArgumentNullException("npcExecutor"); } if (htmlGenerator == null) { throw new ArgumentNullException("htmlGenerator"); } this.callback = callback; this.npcExecutor = npcExecutor; this.htmlGenerator = htmlGenerator; }
public NpcHandler(String clientString, INpcServerCallback callback, NpcExecutor npcExecutor, INpcHtmlGenerator npcHtmlGenerator) { if (callback == null) { throw new ArgumentNullException("callback"); } if (npcExecutor == null) { throw new ArgumentNullException("npcExecutor"); } if (npcHtmlGenerator == null) { throw new ArgumentNullException("npcHtmlGenerator"); } this.clientString = clientString; this.callback = callback; this.npcExecutor = npcExecutor; this.htmlGenerator = npcHtmlGenerator; }
public NpcServerMultiThreaded(INpcServerCallback callback, NpcExecutor npcExecutor, INpcHtmlGenerator htmlGenerator, UInt16 port) { if (callback == null) { throw new ArgumentNullException("callback"); } if (npcExecutor == null) { throw new ArgumentNullException("npcReflector"); } if (htmlGenerator == null) { throw new ArgumentNullException("htmlGenerator"); } this.callback = callback; this.npcExecutor = npcExecutor; this.htmlGenerator = htmlGenerator; this.port = port; this.keepRunning = false; }
public NpcServerSingleThreaded(INpcServerCallback callback, NpcExecutor npcExecutor, INpcHtmlGenerator htmlGenerator, Socket listenSocket) { if (callback == null) { throw new ArgumentNullException("callback"); } if (npcExecutor == null) { throw new ArgumentNullException("npcExecutor"); } if (htmlGenerator == null) { throw new ArgumentNullException("htmlGenerator"); } this.callback = callback; this.npcExecutor = npcExecutor; this.htmlGenerator = htmlGenerator; selectServer = new SelectServer(false, new Buf(SingleThreadedReceiveBufferLength)); selectServer.control.AddListenSocket(listenSocket, AcceptCallback); }
public NpcServerMultiThreaded(INpcServerCallback callback, NpcExecutor npcExecutor, String htmlPageTitle, UInt16 port) : this(callback, npcExecutor, new DefaultNpcHtmlGenerator(htmlPageTitle, npcExecutor), port) { }