
138
"C" Programming Guide For Optimus S/R
3.13.5 WLAN (802.11b)
Native Programming Interface
Opening & Closing of Connections
The section gives details on how to open and close connections.
The
Nopen()
function is used to establish connections. After the connection is
successfully established,
Nopen()
will return a connection number, which is used to
identify this particular connection in subsequent calls to other TCP/IP stack
routines. Call
Nclose()
to close a specific connection.
Note: Before reading and writing to the remote host, a connection must be established (i.e.
opened).
Nclose
Purpose
To close a connection.
Syntax
int Nclose (int conno);
int conno; /* the connection to be closed */
Example
Nclose (conno);
Description
This routine closes a previously established connection. The connection
number
conno
is a return value of Nopen().
Return
If successful, it returns 0.
On error, it returns a negative value to indicate a specific error condition.
See Also
Nopen, socket_fin
Nopen
Purpose
To open a connection.
Syntax
int Nopen (const char *remote_ip, const char *proto, int lp, int rp, int flags);
remote_ip
It can be one of these two forms:
"n1.n2.n3.n4" for remote host IP;
"*" for any host, passive open.
proto
Protocol stack to be used, "TCP/IP" or "UDP/IP".
lp
Local port number. If this is an active open (client), the local
port is often an ephemeral port, and a suitable random value
can be obtained using Nportno() or set lp to 0.
Содержание 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...