Logo Search packages:      
Sourcecode: nailgun version File versions  Download package

Socket com::martiansoftware::nailgun::NGSession::nextSocket (  )  [inline, private]

Returns the next socket to process. This will block the NGSession thread until there's a socket to process or the NGSession has been shut down.

Returns:
the next socket to process, or null if the NGSession has been shut down.

Definition at line 153 of file NGSession.java.

References done, and lock.

Referenced by run(), and shutdown().

                                  {
            Socket result = null;
            synchronized(lock) {
                  result = nextSocket;
                  while (!done && result == null) {
                        try {
                              lock.wait();
                        } catch (InterruptedException e) {
                              done = true;
                        }
                        result = nextSocket;
                  }
                  nextSocket = null;
            }
            return (result);
      }


Generated by  Doxygen 1.6.0   Back to index