Berkeley description: Some invalid argument was supplied
(for example, specifying an invalid level to the setsockopt() function).
Microsoft C description: Invalid argument. An invalid
value was given for one of the arguments to a function. For example, the
value given for the origin when positioning a file pointer (by means of
a call to fseek) is before the beginning of the file.
WinSock description: Similar to Berkeley & Microsoft
C, the generic meaning is that an application passed invalid input
parameter in a function call. The error refers to content as well as
value (e.g. it may occur when a pointer to a structures is invalid or
when a value in structure field is invalid). In some instances, it also
refers to the current state of the socket input parameter.
Detailed descriptions (relevant to socket states):
accept(): listen() was not invoked prior to
bind(): socket already
bound to an address
socket not bound with
listen(): socket not
bound with or already
recv() & recvfrom(): socket not bound (for Dgram) or not yet
connected (for Stream), or the requested length is zero (whether a
is acceptable as a non-negative value is unclear, so don't use
send() & sendto(): socket not bound (for Dgram) or not yet
connected (for Stream)
The v1.1 specification also has a detailed description for the
connect() function which
says: "socket not already bound to an address." This text is a
typo which makes no sense. Ignore it. The standard meaning for WSAEINVAL
connect() (invalid argument).