|
CAEN Utility
2.0.2
Utilities for CAEN projects
|
Functions | |
| int32_t | c_socket_server_init (c_socket_t **server, uint32_t inaddr, uint16_t *_port) |
| int32_t | c_socket_server_accept (const c_socket_t *server, c_socket_t **client) |
| int32_t | c_socket_client_sockaddr_connect (c_socket_t **client, const struct sockaddr *addr_server, c_socklen_t addrlen) |
| int32_t | c_socket_client_connect (c_socket_t **client, const char *hostname, uint16_t port) |
| int32_t c_socket_server_init | ( | c_socket_t ** | server, |
| uint32_t | inaddr, | ||
| uint16_t * | _port | ||
| ) |
Server function. Init the socket to receive connection from inaddr:port
| [in,out] | server | a location where to put the address of a socket initialized with c_socket_new and to be freed |
| [out] | inaddr | the address we agree to accept. INADDR_ANY (0x00000000) to accept any address. |
| [out] | _port | pointer to a uint16_t with the port. If value is 0, a port is automatically choosen and the value is set accordingly |
Definition at line 317 of file CAENSocket.c.
| int32_t c_socket_server_accept | ( | const c_socket_t * | server, |
| c_socket_t ** | client | ||
| ) |
Server function. Accept new connection on the initialized socket
| [in] | server | a pointer passed through c_socket_server_init() |
| [out] | client | a location where to put the address of a socket initialized with c_socket_new and to be freed |
Definition at line 395 of file CAENSocket.c.
| int32_t c_socket_client_sockaddr_connect | ( | c_socket_t ** | client, |
| const struct sockaddr * | addr_server, | ||
| c_socklen_t | addrlen | ||
| ) |
Client function. Connect to host, port specified by [addr]
| [in,out] | client | a location where to put the address of a socket initialized with c_socket_new and to be freed |
| [in] | addr_server | the remote address |
| [in] | addrlen | the size, in bytes, of the address structure pointed to by addr |
Definition at line 425 of file CAENSocket.c.
| int32_t c_socket_client_connect | ( | c_socket_t ** | client, |
| const char * | hostname, | ||
| uint16_t | port | ||
| ) |
Client function. Connect to [hostname]:[port]
| [in,out] | client | a location where to put the address of a socket initialized with c_socket_new and to be freed |
| [in] | hostname | the remote address. Either a hostname or an IPv4 address in standard dot notation. |
| [in] | port | the remote port |
Definition at line 467 of file CAENSocket.c.