Package com.martiansoftware.nailgun
Class NGWin32NamedPipeServerSocket
- java.lang.Object
-
- java.net.ServerSocket
-
- com.martiansoftware.nailgun.NGWin32NamedPipeServerSocket
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class NGWin32NamedPipeServerSocket extends java.net.ServerSocket
-
-
Field Summary
Fields Modifier and Type Field Description private static NGWin32NamedPipeLibraryAPIprivate static intBUFFER_SIZEprivate NGWin32NamedPipeSocket.CloseCallbackcloseCallbackprivate java.util.concurrent.LinkedBlockingQueue<com.sun.jna.platform.win32.WinNT.HANDLE>connectedHandlesprivate com.sun.jna.platform.win32.WinNT.HANDLElockHandleprivate intmaxInstancesprivate java.util.concurrent.LinkedBlockingQueue<com.sun.jna.platform.win32.WinNT.HANDLE>openHandlesprivate java.lang.Stringpathprivate booleanrequireStrictLengthprivate static java.lang.StringWIN32_PIPE_PREFIX
-
Constructor Summary
Constructors Constructor Description NGWin32NamedPipeServerSocket(int maxInstances, java.lang.String path)NGWin32NamedPipeServerSocket(int maxInstances, java.lang.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(java.lang.String path)NGWin32NamedPipeServerSocket(java.lang.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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.Socketaccept()voidbind(java.net.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 Detail
-
API
private static final NGWin32NamedPipeLibrary API
-
WIN32_PIPE_PREFIX
private static final java.lang.String WIN32_PIPE_PREFIX
- See Also:
- Constant Field Values
-
BUFFER_SIZE
private static final int BUFFER_SIZE
- See Also:
- Constant Field Values
-
openHandles
private final java.util.concurrent.LinkedBlockingQueue<com.sun.jna.platform.win32.WinNT.HANDLE> openHandles
-
connectedHandles
private final java.util.concurrent.LinkedBlockingQueue<com.sun.jna.platform.win32.WinNT.HANDLE> connectedHandles
-
closeCallback
private final NGWin32NamedPipeSocket.CloseCallback closeCallback
-
path
private final java.lang.String path
-
maxInstances
private final int maxInstances
-
lockHandle
private final com.sun.jna.platform.win32.WinNT.HANDLE lockHandle
-
requireStrictLength
private final boolean requireStrictLength
-
-
Constructor Detail
-
NGWin32NamedPipeServerSocket
public NGWin32NamedPipeServerSocket(java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
NGWin32NamedPipeServerSocket
public NGWin32NamedPipeServerSocket(java.lang.String path, 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
-
NGWin32NamedPipeServerSocket
public NGWin32NamedPipeServerSocket(int maxInstances, java.lang.String path) throws java.io.IOException- Throws:
java.io.IOException
-
NGWin32NamedPipeServerSocket
public NGWin32NamedPipeServerSocket(int maxInstances, java.lang.String path, 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
-
-
Method Detail
-
bind
public void bind(java.net.SocketAddress endpoint) throws java.io.IOException- Overrides:
bindin classjava.net.ServerSocket- Throws:
java.io.IOException
-
accept
public java.net.Socket accept() throws java.io.IOException- Overrides:
acceptin classjava.net.ServerSocket- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.net.ServerSocket- Throws:
java.io.IOException
-
closeOpenPipe
private void closeOpenPipe(com.sun.jna.platform.win32.WinNT.HANDLE handle) throws java.io.IOException- Throws:
java.io.IOException
-
closeConnectedPipe
private void closeConnectedPipe(com.sun.jna.platform.win32.WinNT.HANDLE handle, boolean shutdown) throws java.io.IOException- Throws:
java.io.IOException
-
-