Chapter 3 Terminal Specific Function Library
165
Supplemental Functions
Other useful functions for obtaining additional information or setting control for a
connection are described below.
Nportno
Purpose
To get an ephemeral port number.
Syntax
int Nportno (void);
Example
if ((conno = Nopen (remote_ip, "TCP/IP", Nportno(), 2000, 0)) < 0)
Printf ("Fail to connect Host: %s\r\n", remote_ip);
Description
This function generates a random local port number, which is used in a active
open call to the Nopen() function.
Return
It always returns the port number.
See Also
Nopen
DNS_resolver
Purpose
To get the remote IP address by remote name.
Syntax
int DNS_resolver (const char *remote_host, char *remote_ip);
const char *remote_host; /* remote name */
char *remote_ip; /* pointer to remote_ip returned */
Example
char IP[4];
DNS_resolver ("www.metrologic.com", IP);
Description
This function gets the remote IP address by remote name. It is necessary to
define the DNS server IP before calling this function.
Return
If successful, it returns 0.
On error, it returns a negative value. (?)
See Also
gethostbyname
socket_block
Purpose
To set the connection for blocking operation.
Syntax
int socket_block (int conno);
int conno; /* connection number */
Example
socket_block (conno)
Содержание Optimus R
Страница 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Страница 6: ......
Страница 8: ...2 C Programming Guide For Optimus S R...
Страница 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Страница 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Страница 24: ...18 C Programming Guide For Optimus S R...
Страница 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...
Страница 232: ...226 C Programming Guide For Optimus S R 4 11 Implementation defined Limits limits h float h Refer to limit h and float h...
Страница 238: ...232 C Programming Guide For Optimus S R...