Overview | Package | Class | Tree | Deprecated | Index | Help
| Groovy JDK

## java.net
Class ServerSocket

Method Summary
`Socket` | `accept(Closure closure)` Accepts a connection and passes the resulting Socket to the closure which runs in a new Thread.
`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.

Method Detail

### 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:
  ServerSocket#accept.

### accept

    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:
  ServerSocket#accept.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Groovy JDK