[Top] | [Prev] |
Jonathan Dale
Multimedia Research Group
Department of Electronics and Computer Science
University of Southampton
UK
jd94r@ecs.soton.ac.uk
1. Introduction
The Communication Routines are a small set of C function calls that provide stream (reliable, connection-oriented) and datagram (best-try, connection-less) communication within the Transmission Control Protocol/Internet Protocol (TCP/IP) communication stack. They are based around the Inter-Process Communication (IPC) mechanism called sockets, which provide both stream and datagram oriented services.
TCP/IP supports two essential modes of network communication:
For datagram and broadcast communication channels, the maximum amount of data that can be transmitted at a time is 8192 bytes. For streams, any amount of data can be written to the communication channel but it is the responsibility of the receiving network entity to read the data in a sensible fashion.
For a stream connection, the roles of the client and the server are well defined; the client initiates a connection with the server, an amount of two-way dialogue takes place and then the client closes the connection. The client is always a client and the server is always a server. This means that during registration, the server must register its session first (getting a primary handle) and then, when the client registers its session, the server accepts this connection (getting a secondary handle). The primary handle is used to allow the server to offer a server (to say "Here I am") and the secondary handle is used to actually allow the client and server to communicate. Secondary handles are unaccepted when the communication between the client and the server has finished, and primary handles are unregistered when the server wishes to terminate.
This is demonstrated by the code fragment given in table 1 (most of the function parameters have been omitted for simplicity).
However, with datagram (and broadcast) communication, a server is classed as a server when it receives data from a client. When a server needs to send data back to a client, it must temporarily become a client and register a new communication session. Thus, the terms client and server in datagram communication depend upon what action the network entity is performing.
4. Network Abstraction
The Communication Routines provide a layer of network abstraction above the transport layer of the TCP/IP protocol stack (figure 3) which affords many advantages to the network programmer when compared with standard socket programming:
Parameters
Return values
Error codes
See also
Parameters
Return values
Error codes
Notes
See also
Parameter
Return values
Error codes
Notes
See also
Parameters
Return values
Error codes
Notes
See also
Parameters
Return values
Error codes
Notes
See also
Parameters
Return values
Error codes
Notes
See also
Parameters
Return values
Error codes
Notes
Parameters
Return values
Error code
Return value
Notes
Parameter
Return values
Error codes
Notes
See also
Parameter
Return values
Error codes
Notes
See also
Return values
Error codes
Notes
See also
[Top] | [Prev] |