Package com.martiansoftware.nailgun
Class NGWin32NamedPipeServerSocket
java.lang.Object
java.net.ServerSocket
com.martiansoftware.nailgun.NGWin32NamedPipeServerSocket
- All Implemented Interfaces:
Closeable,AutoCloseable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final NGWin32NamedPipeLibraryprivate static final intprivate final NGWin32NamedPipeSocket.CloseCallbackprivate final LinkedBlockingQueue<com.sun.jna.platform.win32.WinNT.HANDLE> private final com.sun.jna.platform.win32.WinNT.HANDLEprivate final intprivate final LinkedBlockingQueue<com.sun.jna.platform.win32.WinNT.HANDLE> private final Stringprivate final booleanprivate static final String -
Constructor Summary
ConstructorsConstructorDescriptionNGWin32NamedPipeServerSocket(int maxInstances, String path) NGWin32NamedPipeServerSocket(int maxInstances, String path, 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.NGWin32NamedPipeServerSocket(String path, 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
Modifier and TypeMethodDescriptionaccept()voidbind(SocketAddress endpoint) voidclose()private voidcloseConnectedPipe(com.sun.jna.platform.win32.WinNT.HANDLE handle, boolean shutdown) private voidcloseOpenPipe(com.sun.jna.platform.win32.WinNT.HANDLE handle) 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 Details
-
API
-
WIN32_PIPE_PREFIX
- See Also:
-
BUFFER_SIZE
private static final int BUFFER_SIZE- See Also:
-
openHandles
-
connectedHandles
-
closeCallback
-
path
-
maxInstances
private final int maxInstances -
lockHandle
private final com.sun.jna.platform.win32.WinNT.HANDLE lockHandle -
requireStrictLength
private final boolean requireStrictLength
-
-
Constructor Details
-
NGWin32NamedPipeServerSocket
- Throws:
IOException
-
NGWin32NamedPipeServerSocket
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:
IOException
-
NGWin32NamedPipeServerSocket
- Throws:
IOException
-
NGWin32NamedPipeServerSocket
public NGWin32NamedPipeServerSocket(int maxInstances, String path, boolean requireStrictLength) throws 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:
IOException
-
-
Method Details
-
bind
- Overrides:
bindin classServerSocket- Throws:
IOException
-
accept
- Overrides:
acceptin classServerSocket- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classServerSocket- Throws:
IOException
-
closeOpenPipe
- Throws:
IOException
-
closeConnectedPipe
private void closeConnectedPipe(com.sun.jna.platform.win32.WinNT.HANDLE handle, boolean shutdown) throws IOException - Throws:
IOException
-