public void start() throws Exception { // Initialize socket if not done before if (!initialized) { init(); } if (!running) { running = true; paused = false; // Create worker collection if (executor == null) { workers = new WorkerStack(maxThreads); } // Start event poller thread eventPoller = new Poller(); eventPoller.init(); Thread pollerThread = new Thread(eventPoller, getName() + "-Poller"); pollerThread.setPriority(threadPriority); pollerThread.setDaemon(true); pollerThread.start(); // Start acceptor threads for (int i = 0; i < acceptorThreadCount; i++) { Thread acceptorThread = new Thread(new Acceptor(), getName() + "-Acceptor-" + i); acceptorThread.setPriority(threadPriority); acceptorThread.setDaemon(daemon); acceptorThread.start(); } } }
} else { if (proto.endpoint.isRunning()) { proto.endpoint.getEventPoller().add(socket, result.getTimeout(), result.getResumeNotification(), false);
endpoint.getEventPoller().add(socket, timeout, true, true);
endpoint.getEventPoller().add(socket, timeout, true, true);
endpoint.getEventPoller().add(socket, timeout, true, true);
endpoint.getEventPoller().add(socket, timeout, true, true);
proto.endpoint.getEventPoller().add(socket, processor.getTimeout(), processor.getResumeNotification(), false); } else {
proto.endpoint.getEventPoller().add(socket, processor.getTimeout(), processor.getResumeNotification(), false); } else {
proto.endpoint.getEventPoller().add(socket, processor.getTimeout(), processor.getResumeNotification(), false); } else {
} else { if (proto.endpoint.isRunning()) { proto.endpoint.getEventPoller().add(socket, result.getTimeout(), result.getResumeNotification(), false);
proto.endpoint.getEventPoller().add(socket, processor.getTimeout(), processor.getResumeNotification(), false); } else {
} else { if (proto.endpoint.isRunning()) { proto.endpoint.getEventPoller().add(socket, result.getTimeout(), result.getResumeNotification(), false);
} else { if (proto.endpoint.isRunning()) { proto.endpoint.getEventPoller().add(socket, result.getTimeout(), result.getResumeNotification(), false);
public void start() throws Exception { // Initialize socket if not done before if (!initialized) { init(); } if (!running) { running = true; paused = false; // Create worker collection if (executor == null) { workers = new WorkerStack(maxThreads); } // Start event poller thread eventPoller = new Poller(); eventPoller.init(); Thread pollerThread = new Thread(eventPoller, getName() + "-Poller"); pollerThread.setPriority(threadPriority); pollerThread.setDaemon(true); pollerThread.start(); // Start acceptor threads for (int i = 0; i < acceptorThreadCount; i++) { Thread acceptorThread = new Thread(new Acceptor(), getName() + "-Acceptor-" + i); acceptorThread.setPriority(threadPriority); acceptorThread.setDaemon(daemon); acceptorThread.start(); } } }
public void stop() { if (running) { running = false; unlockAccept(); eventPoller.destroy(); eventPoller = null; } }
public void stop() { if (running) { running = false; unlockAccept(); eventPoller.destroy(); eventPoller = null; } }