Socket: 7 Sending and Receiving Data

Up: GEOS SDK TechDocs| Up | Down | Prev: 6 Loading on Connection | Next: 8 Closing the Connection
SocketSend(), SocketRecv(), SocketSetIntSocketOption(), SocketGetIntSocketOption(), SocketSetSocketOption(), SocketGetSocketOption()

Once both sides of a socket communication are set up, they're ready to send data back and forth. The SocketSend() and SocketRecv() routines, described below, allow a socket to transmit and receive data, respectively.

The amount of overhead associated with sending and receiving data depends on the devices involved, the domain, and the delivery type. Be certain that if just one byte of data is sent at a time, time performance will suffer.

Whenever possible, the sender should gather up small pieces of data and send them in one large packet. The optimal size of a packet depends on the device, domain, and delivery type. When designing a communications protocol, it would be worthwhile to figure out which sorts of data may be combined into larger blocks. Note that in some domains, the driver will try to do this gathering of small blocks into large packets for you.


Up: GEOS SDK TechDocs| Up | Down | Prev: 6 Loading on Connection | Next: 8 Closing the Connection