/*
Start the ThreadedServer listening
488631
public synchronized void start() throws Exception
    {
        try
        {
            if (isStarted()) return;

            open();

            _running = true;
            _acceptor = new Acceptor[_acceptors];
            for (int a = 0; a < _acceptor.length; a++)
            {
                _acceptor[a] = new Acceptor();
                _acceptor[a].setDaemon(isDaemon());
                _acceptor[a].start();
            }

            super.start();
        }
        catch (Exception e)
        {
            log.warn("Failed to start: " + this);
            throw e;
        }
    }
563009
def start(self):
        
        # Create the multicast socket (update the group)
        self._socket, self._group = create_multicast_socket(self._group,
                                                            self._port)

        # Start the listening thread
        self._stop_event.clear()
        self._thread = threading.Thread(
            target=self.__read,
            name="MulticastReceiver-{0}".format(self._port))
        self._thread.start()
1020283
public static void main(String[] args) throws TimeoutException, InterruptedException {
    //#thriftserverapi
    Hello.FutureIface impl = new HelloImpl();
    ListeningServer server = Thrift.server().serveIface("localhost:8080", impl);
    Await.ready(server);
    //#thriftserverapi
  }
462898
def __start(self):  # pragma: no cover
        """"""

        assert not self._listener_thread

        self._listener_thread = threading.Thread(target=self.__run_listener,
                                                 name='clearly-listener')
        self._listener_thread.daemon = True
        self._listener_thread.start()
        self._wait_event.wait()
        self._wait_event.clear()
1339992
public void start(final int timeout, boolean daemon) throws IOException {
        this.myServerSocket = this.getServerSocketFactory().create();
        this.myServerSocket.setReuseAddress(true);

        ServerRunnable serverRunnable = createServerRunnable(timeout);
        this.myThread = new Thread(serverRunnable);
        this.myThread.setDaemon(daemon);
        this.myThread.setName("NanoHttpd Main Listener");
        this.myThread.start();
        while (!serverRunnable.hasBinded && serverRunnable.bindException == null) {
            try {
                Thread.sleep(10L);
            } catch (Throwable e) {
                // on android this may not be allowed, that's why we
                // catch throwable the wait should be very short because we are
                // just waiting for the bind of the socket
            }
        }
        if (serverRunnable.bindException != null) {
            throw serverRunnable.bindException;
        }
    }
1218844
def listen(self):
        

        self.listening = True
        if self.threading:
            from threading import Thread
            self.listen_thread = Thread(target=self.listen_loop)
            self.listen_thread.daemon = True
            self.listen_thread.start()

            self.scheduler_thread = Thread(target=self.scheduler)
            self.scheduler_thread.daemon = True
            self.scheduler_thread.start()

        else:
            self.listen_loop()
500100
function listen(self, address, port, addressType, backlog, exclusive) {
    /* TODO Index servers by a self-assigned identifier and the process
     * identifier so messages intended for previous instances do not pass
     * through. */
    servers[port] = self; // Index servers by port.
    self._port = port; // Remember the requested port for close.
    process.send({
        cmd: 'CLUSTER_LISTEN',
        port: port,
        address: address, // For confirmation purposes only.
        addressType: addressType, // We allow the supervisor to infer the address type.
        backlog: backlog, // Used to confirm uniformity of worker requests.
        exclusive: exclusive // TODO use this on the other end
    });
}
136130
public void start() throws IOException {
        myServerSocket = new ServerSocket();
        myServerSocket.bind((hostname != null) ? new InetSocketAddress(
                hostname, myPort) : new InetSocketAddress(myPort));

        myThread = new Thread(new Runnable() {
            @Override
            public void run() {
                do {
                    try {
                        final Socket finalAccept = myServerSocket.accept();
                        registerConnection(finalAccept);
                        finalAccept.setSoTimeout(SOCKET_READ_TIMEOUT);
                        final InputStream inputStream = finalAccept
                                .getInputStream();
                        asyncRunner.exec(new Runnable() {
                            @Override
                            public void run() {
                                OutputStream outputStream = null;
                                try {
                                    outputStream = finalAccept
                                            .getOutputStream();
                                    TempFileManager tempFileManager = tempFileManagerFactory
                                            .create();
                                    HTTPSession session = new HTTPSession(
                                            tempFileManager, inputStream,
                                            outputStream, finalAccept
                                                    .getInetAddress());
                                    while (!finalAccept.isClosed()) {
                                        session.execute();
                                    }
                                } catch (Exception e) {
                                    // When the socket is closed by the client,
                                    // we throw our own SocketException
                                    // to break the "keep alive" loop above.
                                    if (!(e instanceof SocketException && "NanoHttpd Shutdown"
                                            .equals(e.getMessage()))) {
                                        e.printStackTrace();
                                    }
                                } finally {
                                    safeClose(outputStream);
                                    safeClose(inputStream);
                                    safeClose(finalAccept);
                                    unRegisterConnection(finalAccept);
                                }
                            }
                        });
                    } catch (IOException e) {
                    }
                } while (!myServerSocket.isClosed());
            }
        });
        myThread.setDaemon(true);
        myThread.setName("NanoHttpd Main Listener");
        myThread.start();
    }
416488
def listen(self, callback=None, timeout=(5, 300)):
        """"""
        if self._running:
            return False
        # if self.devices() is False:
        #    return False
        self._queue = Queue()
        self._running = True
        self._timeout = timeout
        self._callback_listen = callback
        threading.Thread(target=self._thread_listen, args=()).start()
        threading.Thread(target=self._thread_worker, args=()).start()
        return True
141607
function listen() {
	let httpServer = require('http').createServer(router);
	httpServer.listen(port);
	Coralian.logger.log("Server started");
}
813456
public void start()
  {
    if (! getLifecycle().toStarting()) {
      startListeners();
      return;
    }
    
    //sendAddLoaderEvent();

    //bind();
    
    try {
      make();
    } catch (Exception e) {
      log().log(Level.WARNING, e.toString(), e);
      e.printStackTrace();
    }

    startListeners();

    getLifecycle().toActive();
    
    if (isAdminEnable()) {
      Thread thread = Thread.currentThread();
      ClassLoader loader = thread.getContextClassLoader();
      
      try {
        thread.setContextClassLoader(this);
      
        //_admin = new EnvironmentAdmin(this);
        //_admin.register();
      } finally {
        thread.setContextClassLoader(loader);
      }
    }
  }
978823
final void start() {
        _enabled = true;
        _ignoredSegs.clear();
        _executor = Executors.newSingleThreadExecutor(new DaemonThreadFactory());
        _executor.execute(this);
    }
50052
public void start() {
    syncLock.lock();
    try {
      if (!this.isConfigured) {
        return;
      }
      instanceChangeStreamListener.stop();
      if (listenersEnabled) {
        instanceChangeStreamListener.start();
      }

      if (syncThread == null) {
        syncThread = new Thread(
            new DataSynchronizerRunner(
              new WeakReference<>(this),
              networkMonitor,
              logger
            ),
            "dataSynchronizerRunnerThread"
        );
      }
      if (syncThreadEnabled && !isRunning) {
        syncThread.start();
        isRunning = true;
      }
    } finally {
      syncLock.unlock();
    }
  }
517602
public void start() throws IOException {
    try {
      int port = 0;
      int oriPort = listener.getPort(); // The original requested port
      while (true) {
        try {
          port = webServer.getConnectors()[0].getLocalPort();
          LOG.info("Port returned by webServer.getConnectors()[0]." +
          		"getLocalPort() before open() is "+ port + 
          		". Opening the listener on " + oriPort);
          listener.open();
          port = listener.getLocalPort();
          LOG.info("listener.getLocalPort() returned " + listener.getLocalPort() + 
                " webServer.getConnectors()[0].getLocalPort() returned " +
                webServer.getConnectors()[0].getLocalPort());
          //Workaround to handle the problem reported in HADOOP-4744
          if (port < 0) {
            Thread.sleep(100);
            int numRetries = 1;
            while (port < 0) {
              LOG.warn("listener.getLocalPort returned " + port);
              if (numRetries++ > MAX_RETRIES) {
                throw new Exception(" listener.getLocalPort is returning " +
                		"less than 0 even after " +numRetries+" resets");
              }
              for (int i = 0; i < 2; i++) {
                LOG.info("Retrying listener.getLocalPort()");
                port = listener.getLocalPort();
                if (port > 0) {
                  break;
                }
                Thread.sleep(200);
              }
              if (port > 0) {
                break;
              }
              LOG.info("Bouncing the listener");
              listener.close();
              Thread.sleep(1000);
              listener.setPort(oriPort == 0 ? 0 : (oriPort += 1));
              listener.open();
              Thread.sleep(100);
              port = listener.getLocalPort();
            }
          } //Workaround end
          LOG.info("Jetty bound to port " + port);
          webServer.start();
          // Workaround for HADOOP-6386
          port = listener.getLocalPort();
          if (port < 0) {
            LOG.warn("Bounds port is " + port + " after webserver start");
            for (int i = 0; i < MAX_RETRIES/2; i++) {
              try {
                webServer.stop();
              } catch (Exception e) {
                LOG.warn("Can't stop  web-server", e);
              }
              Thread.sleep(1000);
              
              listener.setPort(oriPort == 0 ? 0 : (oriPort += 1));
              listener.open();
              Thread.sleep(100);
              webServer.start();
              LOG.info(i + "attempts to restart webserver");
              port = listener.getLocalPort();
              if (port > 0)
                break;
            }
            if (port < 0)
              throw new Exception("listener.getLocalPort() is returning " +
                                "less than 0 even after " +MAX_RETRIES+" resets");
          }
          // End of HADOOP-6386 workaround
          break;
        } catch (IOException ex) {
          // if this is a bind exception,
          // then try the next port number.
          if (ex instanceof BindException) {
            if (!findPort) {
              throw (BindException) ex;
            }
          } else {
            LOG.info("HttpServer.start() threw a non Bind IOException"); 
            throw ex;
          }
        } catch (MultiException ex) {
          LOG.info("HttpServer.start() threw a MultiException"); 
          throw ex;
        }
        listener.setPort((oriPort += 1));
      }
    } catch (IOException e) {
      throw e;
    } catch (Exception e) {
      throw new IOException("Problem starting http server", e);
    }
  }
136637
public void startListening() throws FileNotFoundException, ClassNotFoundException, IOException,
        ResourceNotExistingException, TTException {
        mProcessingThread = new Thread() {
            public void run() {
                try {
                    processFileNotifications();
                } catch (InterruptedException | TTException | IOException e) {
                }
            }
        };
        mProcessingThread.start();

        initSessions();
    }
933679
public synchronized void start() throws SocketException {
        if (!isRunning()) {
            DeviceFinder.getInstance().addLifecycleListener(lifecycleListener);
            DeviceFinder.getInstance().addDeviceAnnouncementListener(announcementListener);
            DeviceFinder.getInstance().start();
            for (DeviceAnnouncement device: DeviceFinder.getInstance().getCurrentDevices()) {
                requestPlayerDBServerPort(device);
            }

            new Thread(null, new Runnable() {
                @Override
                public void run() {
                    while (isRunning()) {
                        try {
                            Thread.sleep(500);
                        } catch (InterruptedException e) {
                            logger.warn("Interrupted sleeping to close idle dbserver clients");
                        }
                        closeIdleClients();
                    }
                    logger.info("Idle dbserver client closer shutting down.");
                }
            }, "Idle dbserver client closer").start();

            running.set(true);
            deliverLifecycleAnnouncement(logger, true);
        }
    }
1193669
def _threaded_start(self):
        '''
        
        '''
        self.active = True
        self.thread = Thread(target=self._main_loop)
        self.thread.setDaemon(True)
        self.thread.start()