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 interfaceNGWin32NamedPipeSocket.CloseCallbackprivate classNGWin32NamedPipeSocket.NGWin32NamedPipeSocketInputStreamprivate classNGWin32NamedPipeSocket.NGWin32NamedPipeSocketOutputStream
-
Field Summary
Fields Modifier and Type Field Description private static NGWin32NamedPipeLibraryAPIprivate NGWin32NamedPipeSocket.CloseCallbackcloseCallback(package private) static booleanDEFAULT_REQUIRE_STRICT_LENGTHprivate com.sun.jna.platform.win32.WinNT.HANDLEhandleprivate java.io.InputStreamisprivate java.io.OutputStreamosprivate com.sun.jna.platform.win32.WinNT.HANDLEreaderWaitableprivate booleanrequireStrictLengthprivate com.sun.jna.platform.win32.WinNT.HANDLEwriterWaitable
-
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 voidclose()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
-
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.IOExceptionThe 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:
getInputStreamin classjava.net.Socket
-
getOutputStream
public java.io.OutputStream getOutputStream()
- Overrides:
getOutputStreamin classjava.net.Socket
-
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
-
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
-
-