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 NGWin32NamedPipeLibrary
private static final int
private final NGWin32NamedPipeSocket.CloseCallback
private final LinkedBlockingQueue
<com.sun.jna.platform.win32.WinNT.HANDLE> private final com.sun.jna.platform.win32.WinNT.HANDLE
private final int
private final LinkedBlockingQueue
<com.sun.jna.platform.win32.WinNT.HANDLE> private final String
private final boolean
private 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()
void
bind
(SocketAddress endpoint) void
close()
private void
closeConnectedPipe
(com.sun.jna.platform.win32.WinNT.HANDLE handle, boolean shutdown) private void
closeOpenPipe
(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:
bind
in classServerSocket
- Throws:
IOException
-
accept
- Overrides:
accept
in classServerSocket
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classServerSocket
- Throws:
IOException
-
closeOpenPipe
- Throws:
IOException
-
closeConnectedPipe
private void closeConnectedPipe(com.sun.jna.platform.win32.WinNT.HANDLE handle, boolean shutdown) throws IOException - Throws:
IOException
-