Package com.martiansoftware.nailgun
Class NGUnixDomainSocket
- java.lang.Object
-
- java.net.Socket
-
- com.martiansoftware.nailgun.NGUnixDomainSocket
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class NGUnixDomainSocket extends java.net.SocketImplements aSocketbacked by a native Unix domain socket. Instances of this class always returnnullforSocket.getInetAddress(),Socket.getLocalAddress(),Socket.getLocalSocketAddress(),Socket.getRemoteSocketAddress().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classNGUnixDomainSocket.NGUnixDomainSocketInputStreamprivate classNGUnixDomainSocket.NGUnixDomainSocketOutputStream
-
Field Summary
Fields Modifier and Type Field Description private ReferenceCountedFileDescriptorfdprivate java.io.InputStreamisprivate java.io.OutputStreamos
-
Constructor Summary
Constructors Constructor Description NGUnixDomainSocket(int fd)Creates a Unix domain socket backed by a native file descriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()private voiddoShutdown(int how)java.io.InputStreamgetInputStream()java.io.OutputStreamgetOutputStream()voidshutdownInput()voidshutdownOutput()-
Methods inherited from class java.net.Socket
bind, connect, connect, getChannel, getInetAddress, getKeepAlive, getLocalAddress, getLocalPort, getLocalSocketAddress, getOOBInline, getPort, getReceiveBufferSize, getRemoteSocketAddress, getReuseAddress, getSendBufferSize, getSoLinger, getSoTimeout, getTcpNoDelay, getTrafficClass, isBound, isClosed, isConnected, isInputShutdown, isOutputShutdown, sendUrgentData, setKeepAlive, setOOBInline, setPerformancePreferences, setReceiveBufferSize, setReuseAddress, setSendBufferSize, setSocketImplFactory, setSoLinger, setSoTimeout, setTcpNoDelay, setTrafficClass, toString
-
-
-
-
Field Detail
-
fd
private final ReferenceCountedFileDescriptor fd
-
is
private final java.io.InputStream is
-
os
private final java.io.OutputStream os
-
-
Method Detail
-
getInputStream
public java.io.InputStream getInputStream()
- Overrides:
getInputStreamin classjava.net.Socket
-
getOutputStream
public java.io.OutputStream getOutputStream()
- Overrides:
getOutputStreamin classjava.net.Socket
-
shutdownInput
public void shutdownInput() throws java.io.IOException- Overrides:
shutdownInputin classjava.net.Socket- Throws:
java.io.IOException
-
shutdownOutput
public void shutdownOutput() throws java.io.IOException- Overrides:
shutdownOutputin classjava.net.Socket- Throws:
java.io.IOException
-
doShutdown
private void doShutdown(int how) throws java.io.IOException- 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.Socket- Throws:
java.io.IOException
-
-