Go to the source code of this file.
Enumerator |
---|
NDS_SOCKET_OK |
|
NDS_SOCKET_FAILURE |
|
NDS_SOCKET_TRANSIENT_FAILURE |
|
Allocate a private structure AND the socket_addr_t element. Call daq_private_init to initialize the data elements.
- Parameters
-
Private | pointer to receive new private structure address. |
Close the data socket. daq_private_data_close is protected against invalid Privte pointer of invalid (unopened) socket id.
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.
- Parameters
-
Private | Address of private structure pointer. |
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.
- Parameters
-
Private | is a pointer to the private structure to be initialized. |
Return true if the session has timed out
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.
- Parameters
-
Private | Pointer to private structure |
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.
- Parameters
-
Private | Pointer to the private structure. |
- Returns
- Error if non-zero.
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.
- Parameters
-
Private | is a pointer to the Private structure to be disconnected. |
Test whether the server port is connected.
- Parameters
-
Private | is a pointer to the private structure to be tested. |
- Returns
- Non-zero if the server port is connected.
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.
- Note
- Not protected against invalid Private pointer (NULL) or socket.
- Parameters
-
Private | Private structure pointer. |
NonBlocking | Select Blocking/Non-Blocking I/O. |
- Returns
- Zero if previously blocking I/O.
Allocate an internet stream (tcp) socket to communicate with a server. Set socket to allow reuse.
Record that the last command timed out. We want to close off the session. However we need to record that it happened so a get_last_message call can be given a good message.