首页 > 代码库 > socket error code
socket error code
Error Codes
The ERRNO values below are set when API calls fail. Use xn_getlasterror to retrieve the error code after an API call fails. Functionxn_geterror_string) can be used to retrieve the string name of a particular error code.
All errno values are defined in header file Rtipapi.h.
EADDRNOTAVAIL (101)
Endpoint address not available. This error occurs when a match for the requested address is not found in the routing table. Entries are added to the routing table by xn_set_ip and xn_rt_add.
EADDRINUSE (102)
Another socket is already bound to the address specified in bind. Make sure closesocket or xn_abort was called on the other socket bound to the same address. Note that closesocket can take a few minutes to release the socket. You can use socket option SO_REUSEADDR (seesetsockopt) to avoid this error.
EAFNOSUPPORT (103)
Family not supported. This error occurs when the parameter family is not AF_INET for calls to socket.
EARPFULL (104)
ARP table full. This error is reported by send when the ARP cache is full. If this error occurs, increase CFG_ARPCLEN.
EBADBAUD (105)
Invalid baud rate. This error occurs when an invalid baud rate is passed to xn_attach.
EBADCOMMNUM (106)
Invalid COM port number. This error occurs when an invalid COM port is passed to xn_attach. COM port numbers start at 1 for COM1.
EBADDEVICE (107)
Invalid device type. This error occurs when a bad device type, minor number is passed to xn_interface_open or xn_attach. There must be an entry in the Device Table which matches the device type, minor number passed to xn_interface_open or xn_attach.
EBADIFACE (108)
Invalid interface number. This error occurs when an invalid interface number is passed to an API routine.
EBADMASK (109)
Invalid mask. This error is detected if an invalid mask (all FFs) is passed to xn_interface_open for an Ethernet interface.
EBADRESP (110)
Invalid ping response. This error occurs during xn_ping if an invalid response to a ping request is received. An invalid response is detected if the sequence number or the source IP address in the response is incorrect.
ECONNREFUSED (111)
Connection refused. This error can occur during an attempt to connect a TCP socket. It is reported when a reset or an unexpected SYNC message is received.
EDESTADDREQ (112)
Destination address is required. This error is detected when an address to connect to is invalid, i.e. the parameter to connect struct sockaddr * is NULL or the IP address or port number in struct sockaddr * is 0.
EDESTUNREACH (113)
Destination unreachable (ICMP). This error occurs when an ICMP destination unreachable packet for the socket is received.
EFAULT (14)
Invalid parameter (pointer is NULL, etc.).
EIFACECLOSED (115)
Interface closed. An operation was attempted on a closed interface.
EIFACEFULL (116)
Interface table full. This error is detected by xn_attach or xn_interface_open when there is no free entry in the interface table. If this error occurs, increase CFG_NIFACES.
EIFACEOPENFAIL (117)
An attempt to open an interface failed. For Ethernet interfaces, the most frequent cause of this error is an incorrect I/O address, incorrect memory address or an incorrect interrupt number.
EINPROGRESS (118)
Socket is non-blocking but connect would block. A connect operation was done on a non-blocking socket. This is not actually an error. Useselect to wait for the connection to become established.
EINVAL (Borland: 19, Microsoft: 22)
Invalid function call parameter.
EISCONN (120)
Socket is already connected. This error is detected when a connect or listen call is made for a socket which is already connected or listening.
EMCASTFULL (121)
Multicast table full. An attempt to add an entry to the multicast table was made, but the table was full. If this error occurs, increaseCFG_MCLISTSIZE.
EMCASTNOTFOUND (122)
Multicast address not found. An attempt to delete an entry from the multicast table was made, but the entry was not in the table.
EMFILE (Borland: 4, Microsoft: 24)
Out of ports. This error will occur if allocation of a port structure fails during a call to socket. RTIP-32 supports 16 TCP and 6 UDP ports. Check that the application calls xn_abort or closesocket after a socket is no longer needed. For TCP, make sure all the data in the input window has been read before the socket is closed.
ENETDOWN (124)
Network is down. This error is reported if a send times out or the network is unable to transmit.
ENETUNREACH (125)
Network unreachable (keep alive failed). This error occurs when keep alive closes a TCP socket due to the remote host not responding to keep alive packets.
ENOPKTS (126)
Out of DCUs (packet buffers). This error occurs when a DCU could not be allocated. This error could be caused by not enough DCUs being allocated (see CFG_NUM_PACKETS0 through CFG_NUM_PACKETS5), packets not being freed, or a task such as the IP task, is not getting a turn to run.
ENOPROTOOPT (127)
Option parameter is invalid. This error occurs when the option parameter to getsockopt or setsockopt is invalid.
ENOTCONN (128)
Socket is not connected. This error occurs when an operation such as send or recv was performed on a socket which was in an invalid state for the attempted operation.
ENOTINITIALIZED (129)
RTIP-32 not initialized. This error occurs when xn_rtip_init has not been called prior to calling an API routine.
ENOTSOCK (130)
Invalid socket descriptor. An invalid socket descriptor was passed to an API function. The socket descriptor returned by calls to socket oraccept needs to be passed to bind/connect/send, etc.
ENUMDEVICE (131)
Not enough devices. There are not enough data structures allocated for a device, i.e. the minor number specified is larger than the number of devices supported.
EOPNOTSUPPORT (132)
Socket type or specified operation not supported for this function. This error is reported if the requested operation is not supported, such as the socket type is not TCP or UDP.
EOUTPUTFULL (133)
send failed due to output list being full. This error is reported by any API call which transmits a packet when the output list is full. The output list size is limited by calling xn_interface_opt using IO_MAX_OUTPUT_QUE.
EPROBEFAIL (134)
Could not determine device. This error is reported by xn_interface_open when the type of Ethernet device cannot be determined.
ERENTRANT (135)
A non-reentrant function was reentered. This error is detected if xn_bootp or xn_rarp is reentered.
ERTNOTFOUND (136)
Routing Table entry not found. This error is reported by xn_rt_del when the requested entry to delete is not in the routing table.
ERTFULL (137)
Routing table full. This error is reported by xn_set_ip or xn_rt_add when an entry cannot be added to the routing table because it is full. If more entries are needed, increase CFG_RTSIZE.
ERSCINITFAIL (138)
Initialize failed. This error is reported by xn_rtip_init if initialization of resources such as signals or semaphores, or spawning a task failed.
ESHUTDOWN (139)
Illegal operation due to socket shutdown. An illegal operation was attempted on a socket which has had the operation disabled by a call toshutdown.
ETIMEDOUT (140)
Timeout. An operation such as connect, recv orsend timed out. For TCP, this error could occur during a send operation if the remote host is not responding with acknowledgments. This could also occur if the remote host is not responding to an ARP request.
ETNOSUPPORT (141)
Type not supported. This error is detected by socket when the type of socket trying to allocate is not SOCK_STREAM (TCP) or SOCK_DGRAM (UDP).
EWOULDARP (142)
send would ARP, but ARP is disabled. This error is detected when a send needs to determine an Ethernet address but ARP is disabled.
EWOULDBLOCK (143)
The socket is non-blocking, but the called function would block. This error is detected when a requested operation is not ready to be done, but the socket is set to a non-blocking mode. select can be used to wait with timeout for the operation to become ready.
ETABLEFULL (144)
A global table if full. The error can be generated when the device table, interface table, or arp cache table need to be extended.
EARPINPROGRESS (148)
xn_arp_remote was called, but no ARP request has been sent out as an ARP request is already pending.
EDEVICENOTBOUND (158)
xn_bind_xxx() not called for device which is being opened.
EHTABLEFULL (200)
The global host table is full. An attempt by xn_add_host_table_entry was made to add an entry to the host table, but the table was full. The table has room for 6 hosts.
EENTRYNOTFOUND (201)
The host table entry was not found. An attempt to delete an entry in the host table failed since the entry was not in the host table.
ETOOMANYSERVERS (202)
The DNS server list is full. An attempt by xn_set_server_list to add a server to the server list failed because the table is full. The size of the DNS server table is 5.
ENO_RECOVERY (203)
A DNS server returned one of the following errors:
Unable to interpret inquiry.
Server refused the request due to policy reasons.
ENAME_TOO_LONG (204)
DNS name is too long. The host name returned by the server is longer 100 characters.
ETRYAGAIN (205)
DNS call to socket function failed. The DNS server returned the error code "unsuccessful" due to a problem with the name server in response to a request.
ENODATA (206)
Data not available. The DNS server returned error "requested name does not exist".
ENORESPONSE (207)
Socket call within DNS failed. A call to a socket routine failed, probably because no response was received from the server.
ENOSERVERS (208)
No DNS server in server table. The function xn_set_server_list needs to be called to set up a list of servers to send DNS requests to.
EMODEMNORING (209)
No ring received in specified time. This error occurs when no incoming call is detected in the given timeout.
EMODEMSENDFAILED (210)
Sending a character over a serial link failed.
EMODEMEBADRESP (211)
Unexpected response from modem.
EPPPFULL (300)
Chap secret table is full. The table used to hold secrets for CHAP has 5 slots.
EPPPNOTOPEN (301)
PPP is not open for IP traffic. An attempt to send data over the PPP interface was made, but the IPCP is not enabled, i.e. the state of IPCP is not OPENED. xn_lcp_open needs to be called prior to calling xn_lcp_open if IP packets will be sent over the connection.
EPPPLINEDOWN (302)
PPP line not up. An attempt to send data over a PPP interface was made, but the PPP connection was not up. Either xn_lcp_open was called after xn_lcp_open or xn_lcp_open did not succeed.
EPPPNOLINKHDR (303)
PPP link header missing. The buffer containing the PPP packet was invalid. This internal error should never occur.
EPPPBADPKT (304)
PPP bad IP packet. This internal error should never occur.
EPPPTIMEDOUT (305)
PPP LCP open timed out. xn_lcp_open timed out before opening the connection. The amount of time to wait is controlled by a parameter toxn_lcp_open.
EPPPNOTCLOSED (306)
PPP Close timed out. The PPP open operation xn_lcp_open failed since the previous PPP close operation failed. Call xn_ppp_down to reset the state information before retrying xn_lcp_open.
ESNMPFOUND (400)
Trap manager already in table. An attempt to add a trap manager to the trap manager table was made, but the specified manager is already in the table.
ESNMPFULL (401)
Trap manager table full. An attempt to add a trap manager to the trap manager table was made, but the table is full.
ESNMPNOTFOUND (402)
Trap manager not found in table. An attempt to delete a trap manager from the trap manager table was made, but the manager is not in the table.
ESNMPSEND (403)
SNMP could not send the complete error response. Sending the response to an SNMP request failed.
ETOOSMALL (404)
SNMP could not send trap since the parameter buffer was not large enough.
EDHCPSERVNORESP (600)
DHCP server not responding.
EDHCPSERVBADRESP (601)
Bad response from DHCP server.
EDHCPSERVNOOFFER (602)
No DHCPOFFERS from DHCP server met the user‘s criteria.
EDHCPSERVNOACK (603)
Acknowledgment from DHCP server not received.
EDHCPSERVNOACKNAK (604)
Nak not received from DHCP server.
EDHCPOPNOTFOUND (605)
Option not found in DHCP server response.
EDHCPOPOVERFLOW (606)
Size of DHCP option exceeds allocated buffer.