#include <cio/socket.h>
Functions | |
int | cio_connect (int sockfd, const struct sockaddr *addr, socklen_t addrlen) |
int | cio_accept (int sockfd, struct sockaddr *addr, socklen_t *addrlen) |
int | cio_accept4 (int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags) |
ssize_t | cio_recv (int sockfd, void *buf, size_t len, int flags) |
ssize_t | cio_send (int sockfd, const void *buf, size_t len, int flags) |
int cio_accept | ( | int | sockfd, | |
struct sockaddr * | addr, | |||
socklen_t * | addrlen | |||
) |
Accept a connection on a socket.
sockfd | socket file descriptor | |
addr | buffer for socket address or NULL | |
addrlen | size of the address buffer or NULL |
>=0 | a new connection socket file descriptor | |
-1 | on error with errno set |
fd
should be in non-blocking modeaccept(2)
int cio_accept4 | ( | int | sockfd, | |
struct sockaddr * | addr, | |||
socklen_t * | addrlen, | |||
int | flags | |||
) |
Accept a connection on a socket. ENODATA on close.
sockfd | socket file descriptor | |
addr | buffer for socket address or NULL | |
addrlen | size of the address buffer or NULL | |
flags | for the new file descriptor |
accept4(2)
int cio_connect | ( | int | sockfd, | |
const struct sockaddr * | addr, | |||
socklen_t | addrlen | |||
) |
Initiate a connection on a socket.
sockfd | socket file descriptor | |
addr | socket address | |
addrlen | size of the address |
0 | on success | |
-1 | on error with errno set |
fd
should be in non-blocking modeconnect(2)
ssize_t cio_recv | ( | int | sockfd, | |
void * | buf, | |||
size_t | len, | |||
int | flags | |||
) |
TODO
ssize_t cio_send | ( | int | sockfd, | |
const void * | buf, | |||
size_t | len, | |||
int | flags | |||
) |
TODO