URING++
|
Public Member Functions | |
int | fd () const |
Get the file descriptor of the socket. More... | |
socket (socket &&other) noexcept | |
Move construct a new socket object. More... | |
socket (std::shared_ptr< event_loop > loop, int domain, int type, int protocol) | |
Construct a new socket object. More... | |
socket (std::shared_ptr< event_loop > loop, int fd) | |
Construct a new socket object from a file descriptor. More... | |
~socket () | |
Destroy the socket object. If the socket is still open, it will be closed. More... | |
task< void > | close () |
Close the socket. More... | |
sqe_awaitable | read (void *buf, size_t count) |
Read data from the socket. More... | |
sqe_awaitable | write (void const *buf, size_t count) |
Write data to the socket. More... | |
sqe_awaitable | readv (struct iovec const *iov, int iovcnt) |
Vectorized read from the socket. More... | |
sqe_awaitable | writev (struct iovec const *iov, int iovcnt) |
Vectorized write data to the socket. More... | |
sqe_awaitable | read_fixed (void *buf, size_t count, int buf_index) |
Read data to a preregistered buffer from the socket. More... | |
sqe_awaitable | write_fixed (void const *buf, size_t count, int buf_index) |
Write data from a preregistered buffer to the socket. More... | |
sqe_awaitable | sendmsg (struct msghdr const *msg, int flags=0) |
Send messages to the socket. More... | |
sqe_awaitable | recvmsg (struct msghdr *msg, int flags=0) |
Receive messages from the socket. More... | |
sqe_awaitable | send (void const *buf, size_t len, int flags=0) |
Send data to the socket. More... | |
sqe_awaitable | recv (void *buf, size_t len, int flags=0) |
Receive data from the socket. More... | |
sqe_awaitable | shutdown (int how) |
Shutdown the socket. More... | |
sqe_awaitable | tee (file const &out, size_t count, unsigned int flags) |
Tee the socket to a file. More... | |
sqe_awaitable | tee (socket const &out, size_t count, unsigned int flags) |
Tee the socket to another socket. More... | |
sqe_awaitable | splice_to (pipe const &out, size_t nbytes, unsigned flags) |
Splice the socket to a pipe. More... | |
sqe_awaitable | splice_from (pipe const &in, size_t nbytes, unsigned flags) |
Splice from a pipe to the socket. More... | |
![]() | |
noncopyable (noncopyable &&)=default | |
noncopyable (noncopyable const &)=delete | |
noncopyable & | operator= (noncopyable const &)=delete |
noncopyable & | operator= (noncopyable &&)=default |
Static Public Member Functions | |
static task< socket > | connect (std::shared_ptr< event_loop > loop, std::string const &hostname, std::string const &port) |
Connect to a remote host. More... | |
Friends | |
class | listener |
|
inlinenoexcept |
Move construct a new socket object.
other |
|
inline |
Construct a new socket object.
loop | The event loop. |
domain | The domain of the socket. |
type | The type of the socket. |
protocol | The protocol of the socket. |
|
inline |
Construct a new socket object from a file descriptor.
loop | The event loop. |
fd | The file descriptor. |
|
inline |
Destroy the socket object. If the socket is still open, it will be closed.
|
inline |
Close the socket.
|
inlinestatic |
Connect to a remote host.
loop | The event loop. |
hostname | The hostname of the remote host. |
port | The port of the remote host. |
|
inline |
Get the file descriptor of the socket.
|
inline |
Read data from the socket.
buf | The buffer to read into. |
count | The number of bytes to read. |
|
inline |
Read data to a preregistered buffer from the socket.
buf | The preregistered buffer to read into. |
count | The number of bytes to read. |
buf_index | The index of the preregistered buffer to read into. |
|
inline |
Vectorized read from the socket.
iov | The vector of buffers to read into. |
iovcnt | The number of buffers to read. |
|
inline |
Receive data from the socket.
buf | The buffer to receive into. |
len | The number of bytes to receive. |
flags | The flags to use. |
|
inline |
Receive messages from the socket.
msg | The messages to receive. |
flags | The flags to use. |
|
inline |
Send data to the socket.
buf | The buffer to send. |
len | The number of bytes to send. |
flags | The flags to use. |
|
inline |
Send messages to the socket.
msg | The messages to send. |
flags | The flags to use. |
|
inline |
|
inline |
Splice from a pipe to the socket.
in | The pipe to splice from. |
nbytes | The number of bytes to splice. |
flags | The flags to use. |
|
inline |
Splice the socket to a pipe.
out | The pipe to splice to. |
off_out | The offset to splice to. |
nbytes | The number of bytes to splice. |
flags | The flags to use. |
sqe_awaitable uringpp::socket::tee | ( | file const & | out, |
size_t | count, | ||
unsigned int | flags | ||
) |
Tee the socket to a file.
out | The file to tee to. |
count | The number of bytes to tee. |
flags | The flags to use. |
|
inline |
Tee the socket to another socket.
out | The socket to tee to. |
count | The number of bytes to tee. |
flags | The flags to use. |
|
inline |
Write data to the socket.
buf | The buffer to write from. |
count | The number of bytes to write. |
|
inline |
Write data from a preregistered buffer to the socket.
buf | The preregistered buffer to write from. |
count | The number of bytes to write. |
buf_index | The index of the preregistered buffer to write from. |
|
inline |
Vectorized write data to the socket.
iov | The iovec to write from. |
iovcnt | The number of iovecs to write. |