Package com.martiansoftware.nailgun
Class NGUnixDomainServerSocket
- java.lang.Object
-
- java.net.ServerSocket
-
- com.martiansoftware.nailgun.NGUnixDomainServerSocket
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class NGUnixDomainServerSocket extends java.net.ServerSocketImplements aServerSocketwhich binds to a local Unix domain socket and returns instances ofNGUnixDomainSocketfromaccept().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNGUnixDomainServerSocket.NGUnixDomainServerSocketAddress
-
Field Summary
Fields Modifier and Type Field Description private intbacklogprivate static intDEFAULT_BACKLOGprivate java.util.concurrent.atomic.AtomicIntegerfdprivate booleanisBoundprivate booleanisClosed
-
Constructor Summary
Constructors Constructor Description NGUnixDomainServerSocket()Constructs an unbound Unix domain server socket.NGUnixDomainServerSocket(int backlog)Constructs an unbound Unix domain server socket with the specified listen backlog.NGUnixDomainServerSocket(int backlog, java.lang.String path)Constructs and binds a Unix domain server socket to the specified path with the specified listen backlog.NGUnixDomainServerSocket(java.lang.String path)Constructs and binds a Unix domain server socket to the specified path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.Socketaccept()voidbind(java.net.SocketAddress endpoint)voidclose()-
Methods inherited from class java.net.ServerSocket
bind, getChannel, getInetAddress, getLocalPort, getLocalSocketAddress, getReceiveBufferSize, getReuseAddress, getSoTimeout, implAccept, isBound, isClosed, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSocketFactory, setSoTimeout, toString
-
-
-
-
Field Detail
-
DEFAULT_BACKLOG
private static final int DEFAULT_BACKLOG
- See Also:
- Constant Field Values
-
fd
private final java.util.concurrent.atomic.AtomicInteger fd
-
backlog
private final int backlog
-
isBound
private boolean isBound
-
isClosed
private boolean isClosed
-
-
Constructor Detail
-
NGUnixDomainServerSocket
public NGUnixDomainServerSocket() throws java.io.IOExceptionConstructs an unbound Unix domain server socket.- Throws:
java.io.IOException
-
NGUnixDomainServerSocket
public NGUnixDomainServerSocket(int backlog) throws java.io.IOExceptionConstructs an unbound Unix domain server socket with the specified listen backlog.- Throws:
java.io.IOException
-
NGUnixDomainServerSocket
public NGUnixDomainServerSocket(java.lang.String path) throws java.io.IOExceptionConstructs and binds a Unix domain server socket to the specified path.- Throws:
java.io.IOException
-
NGUnixDomainServerSocket
public NGUnixDomainServerSocket(int backlog, java.lang.String path) throws java.io.IOExceptionConstructs and binds a Unix domain server socket to the specified path with the specified listen backlog.- Throws:
java.io.IOException
-
-
Method Detail
-
bind
public void bind(java.net.SocketAddress endpoint) throws java.io.IOException- Overrides:
bindin classjava.net.ServerSocket- Throws:
java.io.IOException
-
accept
public java.net.Socket accept() throws java.io.IOException- Overrides:
acceptin classjava.net.ServerSocket- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.net.ServerSocket- Throws:
java.io.IOException
-
-