uvcc
libuv C++ bindings
uv::connect Class Reference

Stream connect request type. More...

#include "request-stream.hpp"

Inheritance diagram for uv::connect:
uv::request

Public Types

using uv_t = ::uv_connect_t
 
using on_request_t = std::function< void(connect _request) >
 The function type of the callback called after connection is done. More...
 
- Public Types inherited from uv::request
using uv_t = ::uv_req_t
 
using on_destroy_t = std::function< void(void *_data) >
 The function type of the callback called when the request object is about to be destroyed.
 

Public Member Functions

 connect (const connect &)=default
 
connectoperator= (const connect &)=default
 
 connect (connect &&) noexcept=default
 
connectoperator= (connect &&) noexcept=default
 
on_request_ton_request () const noexcept
 
stream handle () const noexcept
 The stream which this connect request has been running on.
 
template<typename _T_ , typename = std::enable_if_t< is_one_of< _T_, ::sockaddr, ::sockaddr_in, ::sockaddr_in6, ::sockaddr_storage >::value >>
int run (tcp &_tcp, const _T_ &_sockaddr)
 Run the request for uv::tcp stream. More...
 
void run (pipe &_pipe, const char *_name)
 Run the request for uv::pipe stream. More...
 
 operator const uv_t * () const noexcept
 
 operator uv_t * () noexcept
 
- Public Member Functions inherited from uv::request
 request (const request &_that)
 
requestoperator= (const request &_that)
 
 request (request &&_that) noexcept
 
requestoperator= (request &&_that) noexcept
 
void swap (request &_that) noexcept
 
std::uintptr_t id () const noexcept
 
long nrefs () const noexcept
 The current number of existing references to the same object as this request variable refers to.
 
int uv_status () const noexcept
 The status value returned by the last executed libuv API function on this request.
 
on_destroy_ton_destroy () const noexcept
 
::uv_req_type type () const noexcept
 The tag indicating a libuv type of the request. More...
 
const char * type_name () const noexcept
 A string containing the name of the request type.
 
void *const & data () const noexcept
 The pointer to the user-defined arbitrary data. libuv and uvcc does not use this field.
 
void *& data () noexcept
 
int cancel () noexcept
 Cancel a pending request. More...
 
 operator const uv_t * () const noexcept
 
 operator uv_t * () noexcept
 
 operator bool () const noexcept
 Equivalent to (uv_status() >= 0).
 

Detailed Description

Stream connect request type.

See also
libuv API documentation: uv_stream_t — Stream handle,
uv_tcp_t — TCP handle,
uv_pipe_t — Pipe handle.

Definition at line 25 of file request-stream.hpp.

Member Typedef Documentation

◆ on_request_t

using uv::connect::on_request_t = std::function< void(connect _request) >

The function type of the callback called after connection is done.

See also
libuv API documentation: uv_connect_cb.

Definition at line 35 of file request-stream.hpp.

Member Function Documentation

◆ run() [1/2]

template<typename _T_ , typename = std::enable_if_t< is_one_of< _T_, ::sockaddr, ::sockaddr_in, ::sockaddr_in6, ::sockaddr_storage >::value >>
int uv::connect::run ( tcp _tcp,
const _T_ &  _sockaddr 
)
inline

Run the request for uv::tcp stream.

See also
libuv API documentation: uv_tcp_connect().

Definition at line 74 of file request-stream.hpp.

◆ run() [2/2]

void uv::connect::run ( pipe _pipe,
const char *  _name 
)
inline

Run the request for uv::pipe stream.

See also
libuv API documentation: uv_pipe_connect().

Definition at line 96 of file request-stream.hpp.


The documentation for this class was generated from the following file: