Socket error code

socket error code

Socket Error 10060 is basically a connection time-out error. This error occurs while connecting to the Internet and the client using the proxy system or on. Winsock Error Codes ; 10054, WSAECONNRESET, Connection reset by peer ; 10055, WSAENOBUFS, No buffer space available ; 10056, WSAEISCONN, Socket is already. Socket errors 10060, 10061, 10064, 10065. An socket error the 10060 range is a Winsock error generally caused by either outgoing connection problems or. socket error code Type tab.

  • Verify that the problem is not local by trying to connect to an alternate server.

  • If a server name was used, verify it resolves to the correct address.

  • If using a local server table for server name resolution, check to see that it doesn't resolve to an obsolete address.

  • Try pinging the address.

  • If you are using a router, verify the router is up and running (check by pinging it and then ping an address outside of the router).

  • Do a traceroute to the destination to verify all routers along the connection path are operational.

  • Verify that your subnet mask is setup properly.

  •  

    for error WSAECONNREFUSED (10061)

    1. The remote host actively refused the attempt to connect to it.

    2. Verify that the destination server name or IP address is correct

    3. Verify that the connection port number is correct (under Site Settings

      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. Function xn_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.

      EADDRINUSE (100)

      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 (see setsockopt) to avoid this error.

      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.

      EAFNOSUPPORT (102)

      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.

      ECONNREFUSED (107)

      Connection refused. This error can occur during an attempt to connect a TCP socket. It is reported when a order close error 4051 or an unexpected SYNC message is received.

      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. Socket error code invalid response is detected if the sequence number or the source IP address in the response is incorrect.

      EBADDEVICE (111)

      Invalid device type. This error occurs when a bad device type, socket error code, 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.

      EINPROGRESS (112)

      Socket is non-blocking but connect would block. A connect operation was done on a non-blocking socket. This is not actually an error. Use select to wait for the connection to become established.

      EWOULDBLOCK (112)

      Same as EINPROGRESS.

      EISCONN (113)

      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.

      EFAULT (14)

      Invalid parameter (pointer is NULL, etc.).

      ENETDOWN (116)

      Network is down, socket error code. This error is reported if a send times out or the network is unable to transmit.

      EIFACEOPENFAIL (117)

      An attempt to open socket error code interface failed, socket error code. For Ethernet interfaces, the most frequent cause of this error is an incorrect I/O address, incorrect memory address or an incorrect interrupt number.

      ENETUNREACH (118)

      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.

      EINVAL (Borland: 19, Microsoft: 22)

      Invalid function call parameter.

      ENODATA (120)

      Data not available. The DNS server returned error "requested name does not exist".

      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, increase CFG_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.

      ENOPROTOOPT (123)

      Option parameter is invalid. This error occurs socket error code the option parameter to getsockopt or setsockopt is invalid.

      EIFACEFULL (124)

      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.

      EDESTADDREQ (125)

      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.

      ENOTCONN (126)

      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.

      EMFILE (Borland: 4, Microsoft: 24)

      Out of ports. This error startup error windows vista 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, socket error code, make sure all the data in the input window has been read before the socket is closed.

      ENOTSOCK (128)

      Invalid socket descriptor. An invalid socket descriptor was passed to an API function. The socket descriptor returned by calls to socket or accept needs to be passed to bind/connect/send, etc.

      ENOTINITIALIZED (129)

      RTIP-32 not initialized. This error occurs when xn_rtip_init has not been called prior to calling an API routine.

      EOPNOTSUPPORT (130)

      Socket type or specified operation not supported for this function. This error is reported if the requested operation is not supported, socket error code, such as the socket type is not TCP or UDP.

      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.

      ENOPKTS (132)

      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.

      EOUTPUTFULL (133)

      send failed due to output list being full. This socket error code 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, socket error code CFG_RTSIZE.

      ETIMEDOUT (138)

      Timeout, socket error code. An operation such as connect, recv or send 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.

      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 to shutdown.

      ERSCINITFAIL (140)

      Initialize failed. This error is reported by xn_rtip_init if initialization of resources such as signals or semaphores, or spawning a task failed.

      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.

      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.

      EIFACECLOSED (145)

      Interface closed. An operation was attempted on a socket error code interface.

      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.

      EDESTUNREACH (159)

      Destination unreachable (ICMP). This error occurs when an ICMP destination unreachable packet for the socket is received.

      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 socket error code. 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:

      1. Unable to interpret inquiry.
      2. 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.

      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 socket error code 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, socket error code. 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 to xn_lcp_open.

      EPPPNOTCLOSED (306)

      PPP Close timed out. The PPP open socket error code 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 socket error code 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.


      UpWLAN Driver

      Connection.

    4. Switch to the opposite data connection type (PASV or PORT) under Site Settings FORMAT_MESSAGE_IGNORE_INSERTS, socket error code, 0, WSAGetLastError(), 0, message, 256, socket error code, 0); char *nl = strrchr(message, '\n'); if (nl) *nl = 0; return message; #else return strerror(errno); #endif }

      Notice the use of in the Windows section of the code above, socket error code. This is to remove the trailing newline character that Windows includes in error messages. That way the function will return messages without a trailing newline, regardless of whether it's being run on Windows or an Unix-like platform.

      You can use the function as follows:

      socket(0, 0, 0); //definitely causes an error! printf("Last error was: %s\n", get_error_text());

      If you run that code on Linux you might see something like this:

      screenshot showing socket programming error message on Linux

      The same error message on Windows may display as:

      screenshot showing socket programming error message on Windows

      Each operating system will use different error codes and messages, but at least we have portable code to retrieve the last error code and message in a cross-platform way.




      I hope you found this article helpful. I'd love to hear any feedback you might have. Don't hesitate to get in touch.

      You can find the rest of my network programming articles here.