java.lang.Object
com.oracle.libuv.Handle
com.oracle.libuv.PipeHandle
- All Implemented Interfaces:
Closeable,AutoCloseable
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 Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected StreamCloseCallbackprotected StreamConnectCallbackprotected StreamConnectionCallbackprotected StreamReadCallbackprotected StreamShutdownCallbackprotected StreamWriteCallbackprotected boolean -
Method Summary
Modifier and TypeMethodDescriptionintaccept(com.oracle.libuv.StreamHandle client)Accepts connections.intBind the pipe to a file path (Unix) or a name (Windows).protected voidprotected voidcallConnect(int status, Exception error, Object context)protected voidcallConnection(int status, Exception error)protected voidcallRead(ByteBuffer data)protected voidcallShutdown(int status, Exception error, Object context)protected voidvoidclose()intvoidbooleanbooleanintlisten(int backlog)voidvoidreadStop()voidsetCloseCallback(StreamCloseCallback callback)voidsetConnectCallback(StreamConnectCallback callback)voidsetConnectionCallback(StreamConnectionCallback callback)voidsetReadCallback(StreamReadCallback callback)voidsetShutdownCallback(StreamShutdownCallback callback)voidsetWriteCallback(StreamWriteCallback callback)intintintwrite(ByteBuffer buffer)intwrite(ByteBuffer buffer, int offset, int length)long
-
Field Details
-
closed
protected boolean closed -
readStarted
protected boolean readStarted -
onRead
-
onWrite
-
onConnect
-
onConnection
-
onClose
-
onShutdown
-
-
Method Details
-
bind
Bind the pipe to a file path (Unix) or a name (Windows).- Parameters:
name- socket, pipe or FIFO name.- Returns:
0on success, or an errorcode < 0on 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
StreamConnectionCallbackto accept the connection. Before calling this function the client handle must be initialized.- Returns:
0on success, or an errorcode < 0on failure.
-
connect
-
setReadCallback
-
setWriteCallback
-
setConnectCallback
-
setConnectionCallback
-
setCloseCallback
-
setShutdownCallback
-
readStart
public void readStart() -
readStop
public void readStop() -
write
-
write
-
write
-
write
-
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
-
callWrite
-
callConnect
-
callConnection
-
callClose
protected void callClose() -
callShutdown
-