Windows Sockets Return Values

If a Windows Sockets function succeeds, it returns 0. If a VuGen error occurs, an LRS return code is issued. If an error occurs with a socket, it returns one of the Windows Sockets error codes.

To retrieve the error code, evaluate the return value of the function. For example:

rc = lrs_close_socket("socket5");

if (rc==0)

    lr_output_message("Socket 5 was successfully closed ");

else

    lr_output_message("An error occurred while closing the socket, Error Code: %d", rc);

VuGen returns the following error and warning codes during replay of Windows Sockets script:

LRS code
Code
Meaning
Error
  
LRS_GENERIC_ERROR
9001
General system function fault.
LRS_SOCKET_DOESNT_EXIST
9002
An invalid socket descriptor was transferred to the function.
LRS_PARAM_FAILED
9003
Parameterization failed.
LRS_CREATE_SOCK_FAILED
9004
Creation of a new socket failed.
LRS_INVALID_FUNC_PARAM
9005
An invalid parameter was transferred to the function.
LRS_READ_DATA_FILE_ERR
9006
Unable to read from the data file (data.ws)
LRS_DATA_BUFFER_ERR
9007
Error reading data buffer (either from data file or last received buffer).
LRS_UNKNOWN_HOST
9008
Specified host is unknown.
LRS_UNKNOWN_FUNC_PARAM
9009
The specified parameter is unknown.
LRS_DELETE_SOCK_FAILED
9010
An attempt to delete the socket, failed.
LRS_BUFFER_DOESN'T_EXIST
9011
The specified buffer does not exist.
LRS_BUF_ALLOC_ERR
9012
Buffer allocation error occurred.
LRS_TRANSLATION_ERR
9013
Error in buffer translation.
LRS_BUFFER_TYPE_ERR
9014
Wrong buffer type specified.
LRS_SAVE_PARAM_ERR
9015
Error in saving parameter to a variable.
LRS_HOST_FIND_ERR
9016
Error in locating specified host.
LRS_EXIT_BY_TIMEOUT
9017
Exit test after failing to complete operation due to timeout.
LRS_SELECT_ERR
9018
A SELECT related error occurred.
Warning
  
LRS_RECV_MISMATCH
9101
A mismatch occurred between the expected and received buffers.
LRS_STRING_NOT_FOUND
9102
The specified string was not found.

The standard Windows Sockets error codes are:

Windows Sockets code
Error
Meaning
WSAEINTR
10004
Interrupted system call
WSAEBADF
10009
Bad file number
WSEACCES
10013
Access denied
WSAEFAULT
10014
Bad address
WSAEINVAL
10022
Invalid argument
WSAEMFILE
10024
Too many open files
WSAEWOULDBLOCK
10035
Operation would block
WSAEINPROGRESS
10036
Operation now in progress
WSAEALREADY
10037
Operation already in progress
WSAENOTSOCK
10038
Socket operation on non-socket
WSAEDESTADDRREQ
10039
Destination address required
WSAEMSGSIZE
10040
Message too long
WSAEPROTOTYPE
10041
Protocol is wrong type for socket
WSAENOPROTOOPT
10042
Bad protocol option
WSAEPROTONOSUPPORT
10043
Protocol not supported
WSAESOCKTNOSUPPORT
10044
Socket type not supported
WSAEOPNOTSUPP
10045
Operation not supported on socket
WSAEPFNOSUPPORT
10046
Protocol family not supported
WSAEAFNOSUPPORT
10047
Address family unsupported by protocol
WSAEADDRINUSE
10048
Address already in use
WSAEADDRNOTAVAIL
10049
Cannot assign requested address
WSAENETDOWN
10050
Network is down
WSAENETUNREACH
10051
Host is unreachable
WSAENETRESET
10052
Network was reset
WSAECONNABORTED
10053
Software caused connection abort
WSAECONNRESET
10054
Connection reset by peer
WSAENOBUFS
10055
No buffer space is supported
WSAEISCONN
10056
Socket is already connected
WSAENOTCONN
10057
Socket is not connected
WSAESHUTDOWN
10058
Can't send after socket shutdown
WSAETOOMANYREFS
10059
Too many references
WSAETIMEDOUT
10060
Connection timed out
WSAECONNREFUSED
10061
Connection refused
WSAELOOP
10062
Too many levels of symbolic links
WSAENAMETOOLONG
10063
Name too long
WSAEHOSTDOWN
10064
Host is down
WSAEHOSTUNREACH
10065
Host in unreachable
WSAENOTEMPTY
10066
Socket not empty.
WSAEPROCLIM
10067
Too many processes.
WSAEUSERS
10068
Too many users
WSAEDQUOT
10069
DQ out error.
WSAESTALE
10070
Data is stale
WSAEREMOTE
10071
Host in remote
WSASYSNOTREADY
10091
System is not ready
WSAVERNOTSUPPORTED
10092
Version is not supported
WSANOTINITIALISED
10093
Not initialized
WSADISCON
10094
Graceful shutdown in progress.
WSAHOST_NOT_FOUND
11001
Host not found
WSATRY_AGAIN
11002
Try again
WSANO_RECOVERY
11003
Non-recoverable error
WSANO_DATA
11004
No data record available