|
| std::shared_ptr< NetworkStream > | shared_from_this () |
| |
| std::shared_ptr< const NetworkStream > | shared_from_this () const |
| |
| void | Listen (int backlog=kDefaultBacklog) |
| | Start listening for incoming connections.
|
| |
| void | Listen (std::function< void()> callback, int backlog=kDefaultBacklog) |
| | Start listening for incoming connections.
|
| |
| std::shared_ptr< NetworkStream > | Accept () |
| | Accept incoming connection.
|
| |
| bool | Accept (const std::shared_ptr< NetworkStream > &client) |
| | Accept incoming connection.
|
| |
| std::shared_ptr< Stream > | shared_from_this () |
| |
| std::shared_ptr< const Stream > | shared_from_this () const |
| |
| void | Shutdown (const std::shared_ptr< ShutdownReq > &req) |
| | Shutdown the outgoing (write) side of a duplex stream.
|
| |
| void | Shutdown (std::function< void()> callback=nullptr) |
| | Shutdown the outgoing (write) side of a duplex stream.
|
| |
| void | StartRead () |
| | Start reading data from an incoming stream.
|
| |
| void | StopRead () |
| | Stop reading data from the stream.
|
| |
| void | Write (std::span< const Buffer > bufs, const std::shared_ptr< WriteReq > &req) |
| | Write data to the stream.
|
| |
| void | Write (std::initializer_list< Buffer > bufs, const std::shared_ptr< WriteReq > &req) |
| | Write data to the stream.
|
| |
| void | Write (std::span< const Buffer > bufs, std::function< void(std::span< Buffer >, Error)> callback) |
| | Write data to the stream.
|
| |
| void | Write (std::initializer_list< Buffer > bufs, std::function< void(std::span< Buffer >, Error)> callback) |
| | Write data to the stream.
|
| |
| int | TryWrite (std::span< const Buffer > bufs) |
| | Queue a write request if it can be completed immediately.
|
| |
| int | TryWrite (std::initializer_list< Buffer > bufs) |
| | Queue a write request if it can be completed immediately.
|
| |
| int | TryWrite2 (std::span< const Buffer > bufs, Stream &send) |
| | Same as TryWrite() and extended write function for sending handles over a pipe.
|
| |
| int | TryWrite2 (std::initializer_list< Buffer > bufs, Stream &send) |
| | Same as TryWrite() and extended write function for sending handles over a pipe.
|
| |
| bool | IsReadable () const noexcept |
| | Check if the stream is readable.
|
| |
| bool | IsWritable () const noexcept |
| | Checks if the stream is writable.
|
| |
| bool | SetBlocking (bool enable) noexcept |
| | Enable or disable blocking mode for a stream.
|
| |
| size_t | GetWriteQueueSize () const noexcept |
| | Gets the amount of queued bytes waiting to be sent.
|
| |
| uv_stream_t * | GetRawStream () const noexcept |
| | Get the underlying stream data structure.
|
| |
Public Member Functions inherited from wpi::uv::Handle |
| | Handle (const Handle &)=delete |
| |
| | Handle (Handle &&)=delete |
| |
| Handle & | operator= (const Handle &)=delete |
| |
| Handle & | operator= (Handle &&)=delete |
| |
| virtual | ~Handle () noexcept |
| |
| Type | GetType () const noexcept |
| | Get the type of the handle.
|
| |
| std::string_view | GetTypeName () const noexcept |
| | Get the name of the type of the handle.
|
| |
| std::shared_ptr< Loop > | GetLoop () const noexcept |
| | Get the loop where this handle runs.
|
| |
| Loop & | GetLoopRef () const noexcept |
| | Get the loop where this handle runs.
|
| |
| bool | IsActive () const noexcept |
| | Check if the handle is active.
|
| |
| bool | IsClosing () const noexcept |
| | Check if a handle is closing or closed.
|
| |
| void | Close () noexcept |
| | Request handle to be closed.
|
| |
| void | SetLoopClosing (bool loopClosing) noexcept |
| | Set if the loop is closing.
|
| |
| bool | IsLoopClosing () const noexcept |
| | Get the loop closing status.
|
| |
| void | Reference () noexcept |
| | Reference the given handle.
|
| |
| void | Unreference () noexcept |
| | Unreference the given handle.
|
| |
| bool | HasReference () const noexcept |
| | Check if the given handle is referenced.
|
| |
| size_t | RawSize () const noexcept |
| | Return the size of the underlying handle type.
|
| |
| uv_handle_t * | GetRawHandle () const noexcept |
| | Get the underlying handle data structure.
|
| |
| void | SetBufferAllocator (std::function< Buffer(size_t)> alloc, std::function< void(Buffer &)> dealloc) |
| | Set the functions used for allocating and releasing buffers.
|
| |
| void | FreeBuf (Buffer &buf) const noexcept |
| | Free a buffer.
|
| |
| template<typename T = void> |
| std::shared_ptr< T > | GetData () const |
| | Gets user-defined data.
|
| |
| void | SetData (std::shared_ptr< void > data) |
| | Sets user-defined data.
|
| |
| void | SetLogger (Logger *logger) |
| | Sets logger.
|
| |
| Logger * | GetLogger () const |
| | Gets logger.
|
| |
| void | ReportError (int err) const |
| | Report an error.
|
| |
Network stream handle.
This is an abstract type; there are two network stream implementations (Tcp and Pipe).