Package com.martiansoftware.nailgun
Class NGWin32NamedPipeSocket
- java.lang.Object
-
- java.net.Socket
-
- com.martiansoftware.nailgun.NGWin32NamedPipeSocket
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class NGWin32NamedPipeSocket extends java.net.Socket
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interface
NGWin32NamedPipeSocket.CloseCallback
private class
NGWin32NamedPipeSocket.NGWin32NamedPipeSocketInputStream
private class
NGWin32NamedPipeSocket.NGWin32NamedPipeSocketOutputStream
-
Field Summary
Fields Modifier and Type Field Description private static NGWin32NamedPipeLibrary
API
private NGWin32NamedPipeSocket.CloseCallback
closeCallback
(package private) static boolean
DEFAULT_REQUIRE_STRICT_LENGTH
private com.sun.jna.platform.win32.WinNT.HANDLE
handle
private java.io.InputStream
is
private java.io.OutputStream
os
private com.sun.jna.platform.win32.WinNT.HANDLE
readerWaitable
private boolean
requireStrictLength
private com.sun.jna.platform.win32.WinNT.HANDLE
writerWaitable
-
Constructor Summary
Constructors Constructor Description NGWin32NamedPipeSocket(com.sun.jna.platform.win32.WinNT.HANDLE handle, NGWin32NamedPipeSocket.CloseCallback closeCallback)
NGWin32NamedPipeSocket(com.sun.jna.platform.win32.WinNT.HANDLE handle, NGWin32NamedPipeSocket.CloseCallback closeCallback, boolean requireStrictLength)
The doc for InputStream#read(byte[] b, int off, int len) states that "An attempt is made to read as many as len bytes, but a smaller number may be read." However, using requireStrictLength, NGWin32NamedPipeSocketInputStream can require that len matches up exactly the number of bytes to read.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
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
-
API
private static final NGWin32NamedPipeLibrary API
-
DEFAULT_REQUIRE_STRICT_LENGTH
static final boolean DEFAULT_REQUIRE_STRICT_LENGTH
- See Also:
- Constant Field Values
-
handle
private final com.sun.jna.platform.win32.WinNT.HANDLE handle
-
closeCallback
private final NGWin32NamedPipeSocket.CloseCallback closeCallback
-
requireStrictLength
private final boolean requireStrictLength
-
is
private final java.io.InputStream is
-
os
private final java.io.OutputStream os
-
readerWaitable
private final com.sun.jna.platform.win32.WinNT.HANDLE readerWaitable
-
writerWaitable
private final com.sun.jna.platform.win32.WinNT.HANDLE writerWaitable
-
-
Constructor Detail
-
NGWin32NamedPipeSocket
public NGWin32NamedPipeSocket(com.sun.jna.platform.win32.WinNT.HANDLE handle, NGWin32NamedPipeSocket.CloseCallback closeCallback, boolean requireStrictLength) throws java.io.IOException
The doc for InputStream#read(byte[] b, int off, int len) states that "An attempt is made to read as many as len bytes, but a smaller number may be read." However, using requireStrictLength, NGWin32NamedPipeSocketInputStream can require that len matches up exactly the number of bytes to read.- Throws:
java.io.IOException
-
NGWin32NamedPipeSocket
public NGWin32NamedPipeSocket(com.sun.jna.platform.win32.WinNT.HANDLE handle, NGWin32NamedPipeSocket.CloseCallback closeCallback) throws java.io.IOException
- Throws:
java.io.IOException
-
-
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
-
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
-
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
-
-