NetSocket.c
. These utilities are convenience functions that you can use in place of net library functions in applications that use the net library. You can find NetSocket.c
in the folder Libraries\Net\Src
. (On Palm OS® 3.5, NetSocket.c
is in the folder CodeWarrior Libraries\Comms\NetSocket\Src
.)
<unix/sys_socket.h>
. This header file is not included by any other Palm header file; you must explicitly include it in your code.
NetSocket.c
and sys_socket.h
, see the chapter "Network Communication" in the Palm OS Programmer's Companion.
Int32 NetUReadN (NetSocketRef fd, UInt8* bufP, UInt32 numBytes)
  |
|
Descriptor for the open socket. |
  |
|
Pointer to buffer to hold received data. |
  |
|
Number of bytes to read. |
NetLibReceive
until numBytes
have been read or until NetLibReceive
returns an error.
NetUWriteN
NetSocketRef NetUTCPOpen (Char* hostName, Char* serviceName, Int16 port)
  |
|
Remote host, given either by name or by dotted decimal address. |
  |
|
The number of the port to connect to on the remote host. Ignored if serviceName is not NULL . |
serviceName
is given, this function looks up the port number for that service on the remote host and uses it for the connection.
NetLibSocketOpen
and
NetLibSocketConnect
(or socket
and connect
).
NOTE:  This function does not return specific reasons for failure if there is a failure. This function is not production-quality code. It is provided as a quick and dirty way of creating a connection and as sample code that can be used as a reference.
Int32 NetUWriteN (NetSocketRef fd, UInt8* bufP, UInt32 numBytes)
  |
|
Descriptor for the open socket. |
  |
|
Pointer to buffer to write. |
  |
|
Number of bytes to write. |
NetLibSend
until numBytes
have been written or until NetLibSend
returns an error.
NetUReadN
  |   |