Package: java.net

## Class ServerSocket

- - ### Methods Summary

    Methods
    Return type | Name and parameters
    --- | ---
    `Socket` | `accept(boolean runInANewThread, Closure closure)` Accepts a connection and passes the resulting Socket to the closure which runs in a new Thread or the calling thread, as needed.
    `Socket` | `accept(Closure closure)` Accepts a connection and passes the resulting Socket to the closure which runs in a new Thread.

  - #### Methods inherited from class java.lang.Object

    `addShutdownHook`, `any`, `any`, `asBoolean`, `asType`, `collect`, `collect`, `collect`, `dump`, `each`, `eachMatch`, `eachMatch`, `eachWithIndex`, `every`, `every`, `find`, `find`, `findAll`, `findAll`, `findIndexOf`, `findIndexOf`, `findIndexValues`, `findIndexValues`, `findLastIndexOf`, `findLastIndexOf`, `findResult`, `findResult`, `getAt`, `getMetaClass`, `getMetaPropertyValues`, `getProperties`, `grep`, `grep`, `hasProperty`, `identity`, `inject`, `inject`, `inspect`, `invokeMethod`, `is`, `isCase`, `iterator`, `metaClass`, `print`, `print`, `printf`, `printf`, `println`, `println`, `println`, `putAt`, `respondsTo`, `respondsTo`, `setMetaClass`, `split`, `sprintf`, `sprintf`, `stream`, `tap`, `toString`, `use`, `use`, `use`, `with`, `with`, `withCloseable`, `withStream`, `withTraits`

- - ### Methods Detail

    - #### public Socket accept(boolean runInANewThread, Closure closure)

      Accepts a connection and passes the resulting Socket to the closure which runs in a new Thread or the calling thread, as needed.

      Parameters:
        `runInANewThread` - This flag should be true, if the closure should be invoked in a new thread, else false.
        `closure` - a Closure
      Returns:
        a Socket
      Since:
        1.7.6
      See Also:
        ServerSocket#accept()

    - #### public Socket accept(Closure closure)

      Accepts a connection and passes the resulting Socket to the closure which runs in a new Thread.

      Parameters:
        `closure` - a Closure
      Returns:
        a Socket
      Since:
        1.0
      See Also:
        ServerSocket#accept()