Class NGWin32NamedPipeServerSocket

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class NGWin32NamedPipeServerSocket
    extends java.net.ServerSocket
    • 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.Socket accept()  
      void bind​(java.net.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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • WIN32_PIPE_PREFIX

        private static final java.lang.String WIN32_PIPE_PREFIX
        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
      • 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.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
      • 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.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
    • Method Detail

      • bind

        public void bind​(java.net.SocketAddress endpoint)
                  throws java.io.IOException
        Overrides:
        bind in class java.net.ServerSocket
        Throws:
        java.io.IOException
      • accept

        public java.net.Socket accept()
                               throws java.io.IOException
        Overrides:
        accept in class java.net.ServerSocket
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class java.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