Return Value
If no error occurs, Send returns the total number of characters sent. (Note that this can be less than the number indicated by nBufLen.) Otherwise, a value of SOCKET_ERROR is returned, and a specific error code can be retrieved by calling GetLastError. The following errors apply to this member function: WSANOTINITIALISED   A successful AfxSocketInit must occur before using this API. 
WSAENETDOWN   The Windows Sockets implementation detected that the network subsystem failed. 
WSAEACCES   The requested address is a broadcast address, but the appropriate flag was not set. 
WSAEINPROGRESS   A blocking Windows Sockets operation is in progress. 
WSAEFAULT   The lpBuf argument is not in a valid part of the user address space. 
WSAENETRESET   The connection must be reset because the Windows Sockets implementation dropped it. 
WSAENOBUFS   The Windows Sockets implementation reports a buffer deadlock. 
WSAENOTCONN   The socket is not connected. 
WSAENOTSOCK   The descriptor is not a socket. 
WSAEOPNOTSUPP   MSG_OOB was specified, but the socket is not of type SOCK_STREAM. 
WSAESHUTDOWN   The socket has been shut down; it is not possible to call Send on a socket after ShutDown has been invoked with nHow set to 1 or 2. 
WSAEWOULDBLOCK   The socket is ed as nonblocking and the requested operation would block. 
WSAEMSGSIZE   The socket is of type SOCK_DGRAM, and the datagram is larger than the maximum supported by the Windows Sockets implementation. 
WSAEINVAL   The socket has not been bound with Bind. 
WSAECONNABORTED   The virtual circuit was aborted due to timeout or other failure. 
WSAECONNRESET   The virtual circuit was reset by the remote side.