Class PipeHandle

java.lang.Object
com.oracle.libuv.Handle
com.oracle.libuv.PipeHandle
All Implemented Interfaces:
Closeable, AutoCloseable

public class PipeHandle extends Handle
Pipe handles provide an abstraction over streaming files on Unix (including local domain sockets, pipes, and FIFOs) and named pipes on Windows.

See Pipe handle

  • Field Details

  • Method Details

    • bind

      public int bind(String name)
      Bind the pipe to a file path (Unix) or a name (Windows).
      Parameters:
      name - socket, pipe or FIFO name.
      Returns:
      0 on success, or an error code < 0 on failure.
    • accept

      public int accept(com.oracle.libuv.StreamHandle client)
      Accepts connections.

      This call is used in conjunction with listen(int) to accept incoming connections.

      Call this function after receiving a StreamConnectionCallback to accept the connection. Before calling this function the client handle must be initialized.

      Returns:
      0 on success, or an error code < 0 on failure.
    • connect

      public void connect(String name)
    • setReadCallback

      public void setReadCallback(StreamReadCallback callback)
    • setWriteCallback

      public void setWriteCallback(StreamWriteCallback callback)
    • setConnectCallback

      public void setConnectCallback(StreamConnectCallback callback)
    • setConnectionCallback

      public void setConnectionCallback(StreamConnectionCallback callback)
    • setCloseCallback

      public void setCloseCallback(StreamCloseCallback callback)
    • setShutdownCallback

      public void setShutdownCallback(StreamShutdownCallback callback)
    • readStart

      public void readStart()
    • readStop

      public void readStop()
    • write

      public int write(String str)
    • write

      public int write(String str, Charset encoding)
    • write

      public int write(ByteBuffer buffer, int offset, int length)
    • write

      public int write(ByteBuffer buffer)
    • closeWrite

      public int closeWrite()
    • close

      public void close()
    • listen

      public int listen(int backlog)
    • isReadable

      public boolean isReadable()
    • isWritable

      public boolean isWritable()
    • writeQueueSize

      public long writeQueueSize()
    • callRead

      protected void callRead(ByteBuffer data)
    • callWrite

      protected void callWrite(int status, Exception error, Object context)
    • callConnect

      protected void callConnect(int status, Exception error, Object context)
    • callConnection

      protected void callConnection(int status, Exception error)
    • callClose

      protected void callClose()
    • callShutdown

      protected void callShutdown(int status, Exception error, Object context)