Skip to content

Latest commit

 

History

History
54 lines (41 loc) · 2.23 KB

inet_addr.md

File metadata and controls

54 lines (41 loc) · 2.23 KB

Home

Function name : inet_addr

Group: Windows Sockets 2 (Winsock) - Library: ws2_32


The inet_addr function converts a string containing an (Ipv4) Internet Protocol dotted address into a proper address for the IN_ADDR structure.


Code examples:

How to build UDP responder
Winsock: retrieving the host information corresponding to a network address
Winsock: changing the byte ordering
How to retrieve network parameters for the local computer (including Host name, Domain name, and DNS Server)
How to ping a remote site using IP Helper API calls
Winsock: retrieving Web pages using sockets (HTTP, port 80)
Winsock: sending email messages (SMTP, port 25)
Winsock: retrieving directory listing from an FTP server using passive data connection (FTP, port 21)
Winsock: reading email messages (POP3, port 110)
Winsock: connecting to a news server (NNTP, port 119)
How to create non-blocking Winsock server
A client for testing non-blocking Winsock server
Winsock: resolving an address to a host name
Obtaining MAC address through Address Resolution Protocol (ARP) request

Declaration:

unsigned long inet_addr(
  const char   FAR *cp
);  

FoxPro declaration:

DECLARE INTEGER inet_addr IN ws2_32;
	STRING cp  

Parameters:

cp [in] Null-terminated character string representing a number expressed in the Internet standard "."" (dotted) notation.


Return value:

If no error occurs, inet_addr returns an unsigned long value containing a suitable binary representation of the Internet address given. Otherwise the function returns the value INADDR_NONE (0x7F000001).