|
nds2-client - Developer 0.16.7
|
#include "daq_config.h"#include "nds_logging.h"#include "daqc_private.h"#include "daqc_response.h"
Macros | |
| #define | INVALID_SOCKET -1 |
| #define | SHUT_RDWR 2 |
Functions | |
| void | daq_private_init (daq_private_t *Private) |
| void | daq_private_create (daq_private_t **Private) |
| void | daq_private_delete (daq_private_t **Private) |
| int | daq_private_srvr_is_open (daq_private_t *Private) |
| int | daq_private_srvr_nonblocking (daq_private_t *Private, int NonBlocking) |
| Select non-blocking or blocking server socket I/O. | |
| void | daq_private_srvr_close (daq_private_t *Private) |
| Close server socket. | |
| int | daq_private_srvr_connect (daq_private_t *Private) |
| Connect to a server. | |
| void | daq_private_srvr_disconnect (daq_private_t *Private) |
| int | daq_private_srvr_open (daq_private_t *Private) |
| int | daq_private_data_close (daq_private_t *Private) |
| #define INVALID_SOCKET -1 |
| #define SHUT_RDWR 2 |
| void daq_private_create | ( | daq_private_t ** | Private | ) |
Allocate a private structure AND the socket_addr_t element. Call daq_private_init to initialize the data elements.
| Private | pointer to receive new private structure address. |
| int daq_private_data_close | ( | daq_private_t * | Private | ) |
Close the data socket. daq_private_data_close is protected against invalid Privte pointer of invalid (unopened) socket id.
| void daq_private_delete | ( | daq_private_t ** | Private | ) |
Free the private data structure. Call daq_private_srvr_disconnect to free the socket address and then free the Private structure. The Private structure pointer is set to NULL. daq_private_delete is protected against a NULL Private structure pointer address or NULL structure pointer.
| Private | Address of private structure pointer. |
| void daq_private_init | ( | daq_private_t * | Private | ) |
Initialize all fields of a pre-allocated private data structure. The socket numbers are initialized to INVALID_SOCKET and if the server address field is allocated (srvr_addr not NULL), it is zeroed.
| Private | is a pointer to the private structure to be initialized. |
| void daq_private_srvr_close | ( | daq_private_t * | Private | ) |
Close server socket.
Shut down server socket connection and close the socket. Invlidate the socket number. daq_private_srvr_close IS protected against both invalid (NULL) Private pointer and socket number.
| Private | Pointer to private structure |
| int daq_private_srvr_connect | ( | daq_private_t * | Private | ) |
Connect to a server.
Open a connection to the pre-specified server. The socket specified in sockfd is connected to the server whose address is specified in srvr_addr. No check is made for valid (non-NULL) private structure pointer or valid socket number.
| Private | Pointer to the private structure. |
| void daq_private_srvr_disconnect | ( | daq_private_t * | Private | ) |
Free the socket_addr_t storage and set pointer (srvr_addr) to NULL. daq_private_srvr_disconnect is protected against NULL pointers to the private structure and to the socket addr structure.
| Private | is a pointer to the Private structure to be disconnected. |
| int daq_private_srvr_is_open | ( | daq_private_t * | Private | ) |
Test whether the server port is connected.
| Private | is a pointer to the private structure to be tested. |
| int daq_private_srvr_nonblocking | ( | daq_private_t * | Private, |
| int | NonBlocking | ||
| ) |
Select non-blocking or blocking server socket I/O.
Set the server socket for blocking/non-blocking I/O. If the NonBlocking argument is non-zero, the socket is set for non-blocking I/O. If it is zero, the socket is set to block.
| Private | Private structure pointer. |
| NonBlocking | Select Blocking/Non-Blocking I/O. |
| int daq_private_srvr_open | ( | daq_private_t * | Private | ) |
Allocate an internet stream (tcp) socket to communicate with a server. Set socket to allow reuse.