TCP/IP Programming Manual
C Synopsis
#include <socket.h>
#include <in.h>
#include <in6.h> /* for IPv6 use */
#include <if.h>
#include <netdb.h>
error = socket_backup(*message, *brother_phandle);
int error;
struct open_info_message *message;
char *brother_phandle;
error
return value; if the call is successful, a zero is returned. If the call is not successful, –1 is returned.
If the call failed, the external variable errno is set as indicated in Errors (page 194).
message
input value; refer to the FILE_OPEN_ procedure call in the Guardian Procedure Errors and
Messages Manual for a description of this field. The open_info_message structure is shown
in Chapter 4 (page 81).
brother_phandle
input value; refer to the FILE_OPEN_ procedure call in the Guardian Procedure Calls Reference
Manual for a description of this field.
Errors
File-system errors as defined in <errno.h> are returned by this call. For a description of the
file-system error returned, type (from the TACL prompt):
> ERROR error-num
where error-num is the error number returned in errno.
Usage Guideline
The user need only checkpoint the open information for the listening socket, as all open sockets
are closed as a result of the backup application takeover and an ECONNRESET returned to all
operations on these sockets. The application is then responsible for end-to-end re-synchronization
of the data stream. Upon takeover, the backup process is therefore only required to post a new
listen on the existing (checkpointed) socket by issuing a call to accept_nw().
The message is the information that was checkpointed as a result of the primary process calling
socket_get_open_info(). The brother_phandle is the phandle of the primary application
process and can be obtained from a call to PROCESS_GETPAIRINFO. Refer to the FILE_OPEN_()
procedure call in the Guardian Procedure Calls Reference Manual for more information on handling
backup opens.
socket_get_info
The socket_get_info function returns the sockaddr data structure and the sockaddr length
received after a recvfrom_nw call.
C Synopsis
#include <socket.h>
#include <in.h>
#include <in6.h> /* for IPv6 use */
#include <if.h>
#include <netdb.h>
194 Library Routines