The following are RXSOCK functions having to deal with error reporting and display:

SockErrMsg Returns an error message for a specified RXSOCK error name.
SockPSock_Errno Displays an error message for the last RXSOCK error.
SockSock_Errno Returns the Berkeley error number of the last sockets library operation, or returns an error name that corresponds to a Berkeley error number.


SockErrMsg

Returns an error message pertaining to the specified RXSOCK Error Name.

Synopsis

err_message = SockErrMsg(ErrNo)

Args


ErrNo is the RXSOCK Error Name (ie, what RXSOCK sets the REXX variable ErrNo or SockErrNo to) for which the respective error message is returned. See Symbolic error names for ErrNo for a listing of REXX Sock Error Names.

Returns


The error message that pertains to ErrNo.

Notes


The error messages that different socket libraries return may vary.

If passed an Error Name that it doesn't recognize, then SockErrMsg simply returns that same Error Name as the error message. For example, the following call:

SockErrMsg("CTRL-C")
will return an error message of CTRL-C.


SockPSock_Errno

Displays an error message for the last RXSOCK error.

Synopsis

CALL SockPSock_Errno(message)

Args

message is an optional string that is output prior to the error message. A colon followed by a space will be automatically appended to it before the error message is also appended.

Notes

For Windows, the error message is displayed in a message box, and message is the title of the box.

For other operating systems, SockPSock_Errno simply calls the sockets library function psock_errno(). The error message is written to STDERR, and the message pertains only to the last sockets library function (not necessarily the last RXSOCK error). In this case, SockPSock_Errno() is provided only for backward compatibility with older scripts. A script should instead use SockErrMsg() to retrieve an error message that truly reflects the last RXSOCK error, and then use whatever means the script desires to output the message.


SockSock_Errno

Returns the Berkeley error number of the last sockets library operation, or returns an error name that corresponds to a Berkeley error number.

Synopsis

result = SockSock_Errno(BerkeleyNumber)

Args

BerkeleyNumber is the number for which you want the corresponding Symbolic error name.

Returns


If BerkeleyNumber is passed, then this returns the symbolic error name. If BerkeleyNumber is omitted, then this returns that the Berkeley error number for the last sockets library operation.

Notes


Different operating systems may return a different Berkeley error number for a given error. (Different OS vendors sometimes add "offsets" to the berkeley error numbers so that they don't conflict with the error numbers of other system libraries). SockSock_Errno therefore returns an OS-specific number. SockSock_Errno is provided only for backward compatibility with old scripts. You should not use this function unless you're translating a number to an error name, and should not directly reference Berkeley error numbers in your script.