Next: Timeouts.
Up: Socket I/O
Previous: Socket-probing.
  Contents
  Index
The error code argument unifies with the error code returned by the
corresponding socket commands. The error code -2 signifies
timeout for timeout-enabled primitives (see below). The error code
of zero signifies normal termination. Positive error codes denote specific
failures, as defined in BSD sockets. When such a failure occurs, an error
message is printed, but the predicate succeeds anyway. The specific error
codes are part of the socket documentation. Unfortunately, the symbolic
names and error numbers of these failures are different between Unix
compilers and Visual C++. Thus, there is no portable, reliable way to refer
to these error codes. The only reliably portable error codes that can be
used in XSB programs defined through these symbolic constants:
#include "socket_defs_xsb.h"
#define SOCK_OK 0 /* indicates sucessful return from socket */
#define SOCK_EOF -1 /* end of file in socket_recv, socket_get0 */
#include "timer_defs_xsb.h"
#define TIMEOUT_ERR -2 /* Timeout error code */
Luis Fernando P. de Castro
2003-06-27