Example usage for java.net ServerSocket getReuseAddress

List of usage examples for java.net ServerSocket getReuseAddress

Introduction

In this page you can find the example usage for java.net ServerSocket getReuseAddress.

Prototype

public boolean getReuseAddress() throws SocketException 

Source Link

Document

Tests if SocketOptions#SO_REUSEADDR SO_REUSEADDR is enabled.

Usage

From source file:org.mule.transport.tcp.TcpServerSocketFactory.java

protected ServerSocket configure(ServerSocket socket, Boolean reuse, InetSocketAddress address, int backlog)
        throws IOException {
    if (null != reuse && reuse.booleanValue() != socket.getReuseAddress()) {
        socket.setReuseAddress(reuse.booleanValue());
    }//from  ww w .  jav  a2 s . co  m
    // bind *after* setting so_reuseaddress
    socket.bind(address, backlog);
    return socket;
}