#include <glib.h>
Go to the source code of this file.
Functions |
int | socket_bind_listen (int domain, int type, int protocol, const struct sockaddr *address, size_t address_length, int backlog, GError **error) |
| Creates a socket listening on the specified address.
|
int | socket_keepalive (int fd) |
Function Documentation
int socket_bind_listen |
( |
int |
domain, |
|
|
int |
type, |
|
|
int |
protocol, |
|
|
const struct sockaddr * |
address, |
|
|
size_t |
address_length, |
|
|
int |
backlog, |
|
|
GError ** |
error |
|
) |
| |
Creates a socket listening on the specified address.
This is a shortcut for socket(), bind() and listen().
- Parameters:
-
domain | the socket domain, e.g. PF_INET6 |
type | the socket type, e.g. SOCK_STREAM |
protocol | the protocol, usually 0 to let the kernel choose |
address | the address to listen on |
address_length | the size of #address |
backlog | the backlog parameter for the listen() system call |
error | location to store the error occurring, or NULL to ignore errors |
- Returns:
- the socket file descriptor or -1 on error
int socket_keepalive |
( |
int |
fd | ) |
|