Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Error Codes

The following list of macros are used to define the possible error codes.

Errors are listed in numerical order with the error macro name.

Macros

#define SOCK_ERR_ADDR_ALREADY_IN_USE   -2
 
#define SOCK_ERR_ADDR_IS_REQUIRED   -11
 
#define SOCK_ERR_BUFFER_FULL   -14
 
#define SOCK_ERR_CONN_ABORTED   -12
 
#define SOCK_ERR_INVALID   -9
 
#define SOCK_ERR_INVALID_ADDRESS   -1
 
#define SOCK_ERR_INVALID_ARG   -6
 
#define SOCK_ERR_MAX_LISTEN_SOCK   -7
 
#define SOCK_ERR_MAX_TCP_SOCK   -3
 
#define SOCK_ERR_MAX_UDP_SOCK   -4
 
#define SOCK_ERR_NO_ERROR   0
 
#define SOCK_ERR_TIMEOUT   -13
 

#define SOCK_ERR_ADDR_ALREADY_IN_USE   -2

Socket operation cannot bind on the given address. With socket operations, only one IP address per socket is permitted. Any attempt for a new socket to bind with an IP address already bound to another open socket, will return the following error code. States that bind operation failed.

#define SOCK_ERR_ADDR_IS_REQUIRED   -11

Destination address is required. Failure to provide the socket address required for the socket operation to be completed. It is generated as an error to the sendto function when the address required to send the data to is not known.

#define SOCK_ERR_BUFFER_FULL   -14

No buffer space available to be used for the requested socket operation.

Referenced by recv(), recvfrom(), send(), and sendto().

#define SOCK_ERR_CONN_ABORTED   -12

The socket is closed (reset) by the peer. If this error is received, the application should call close().

#define SOCK_ERR_INVALID   -9

The requested socket operation is not valid in the current socket state. For example: accept is called on a TCP socket before bind or listen.

Referenced by bind(), close(), connect(), listen(), secure(), setsockopt(), and smtpConnect().

#define SOCK_ERR_INVALID_ADDRESS   -1

Socket address is invalid. The socket operation cannot be completed successfully without specifying a specific address For example: bind is called without specifying a port number

#define SOCK_ERR_INVALID_ARG   -6

An invalid argument is passed to a socket function. Identifies that socket operation failed

Referenced by accept(), bind(), close(), connect(), get_alpn_index(), get_error_detail(), gethostbyname(), getsockopt(), listen(), recv(), recvfrom(), secure(), send(), sendto(), set_alpn_list(), setsockopt(), and sslSetSockOpt().

#define SOCK_ERR_MAX_LISTEN_SOCK   -7

Exceeded the maximum number of TCP passive listening sockets. Identifies that listen operation failed.

#define SOCK_ERR_MAX_TCP_SOCK   -3

Exceeded the maximum number of TCP sockets. A maximum number of TCP sockets opened simultaneously is defined through TCP_SOCK_MAX. It is not permitted to exceed that number at socket creation. Identifies that socket operation failed.

#define SOCK_ERR_MAX_UDP_SOCK   -4

Exceeded the maximum number of UDP sockets. A maximum number of UDP sockets opened simultaneously is defined through UDP_SOCK_MAX. It is not permitted to exceed that number at socket creation. Identifies that socket operation failed

#define SOCK_ERR_NO_ERROR   0

Successful socket operation. This code is also used with event SOCKET_MSG_RECV if a socket connection is closed. In that case, the application should call close().

Referenced by accept(), bind(), close(), connect(), get_error_detail(), listen(), m2m_ip_cb(), main(), recv(), recvfrom(), secure(), send(), sendto(), setsockopt(), smtpConnect(), socket_cb(), and sslSetSockOpt().

#define SOCK_ERR_TIMEOUT   -13

The socket pending operation has timed out. The socket remains open.