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.Socket
Implements aSocket
backed by a native Unix domain socket. Instances of this class always returnnull
forSocket.getInetAddress()
,Socket.getLocalAddress()
,Socket.getLocalSocketAddress()
,Socket.getRemoteSocketAddress()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
NGUnixDomainSocket.NGUnixDomainSocketInputStream
private class
NGUnixDomainSocket.NGUnixDomainSocketOutputStream
-
Field Summary
Fields Modifier and Type Field Description private ReferenceCountedFileDescriptor
fd
private java.io.InputStream
is
private java.io.OutputStream
os
-
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 void
close()
private void
doShutdown(int how)
java.io.InputStream
getInputStream()
java.io.OutputStream
getOutputStream()
void
shutdownInput()
void
shutdownOutput()
-
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:
getInputStream
in classjava.net.Socket
-
getOutputStream
public java.io.OutputStream getOutputStream()
- Overrides:
getOutputStream
in classjava.net.Socket
-
shutdownInput
public void shutdownInput() throws java.io.IOException
- Overrides:
shutdownInput
in classjava.net.Socket
- Throws:
java.io.IOException
-
shutdownOutput
public void shutdownOutput() throws java.io.IOException
- Overrides:
shutdownOutput
in 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classjava.net.Socket
- Throws:
java.io.IOException
-
-