Sockets are bidirectional
communication mechanisms that provide communication between processes, even if
these processes are located on different machines. Network<ToolKit> is
ideal for building either Internet- or Intranet-based client/server
applications. Network<ToolKit> supports both of the following kinds of
sockets including most of the standard socket options.
- Stream (TCP
) - Stream sockets provide reliable connection-oriented,
point-to-point communication between a server socket and a client socket.
- Datagram (UDP
) - A datagram is a single packet of
information sent from one socket to another. The sender must know the
address of the destination socket. Datagram sockets provide unreliable,
connectionless communication, which does not guarantee datagram delivery.
When writing socket-based
applications, a server must often monitor more than one socket object. For
example, the Internet daemon, inetd
, accepts connections on one of many known sockets and creates an appropriate
child process type to handle an incoming connection on a particular socket. The
I/O multiplexer class addresses this monitoring problem by allowing a process to
wait until an interesting condition occurs on one or more of the sockets the
process is monitoring.
Network<ToolKit> contains a
set of classes that provides the following functionality.
- Availability - With the
rapid growth of the Internet, the Internet Protocol is one of the fastest
growing, generally available transport protocols in existence. Network<ToolKit>
is a generally available solution for network programming.
- Ease of Use - Socket
programming using C interfaces is difficult to learn and use safely.
Network<ToolKit> provides a C++ hierarchy to create and use TCP and
UDP sockets simply and intuitively.
- Comprehensive Interfaces - Network<ToolKit>
interfaces provide simplicity for common use, but not at the expense of
low-level control. Network<ToolKit> provides access to all underlying
socket control parameters and allows for late binding. Full database
interfaces for host, network, and service data are provided.
- Use with Streaming<ToolKit> - Combining
the Streaming<ToolKit> with Network<ToolKit> allows portable
object transport between machines and intuitive IOStream interfaces to
sockets.
This chapter describes the
functionality provided in Network<ToolKit> including socket and I/O
multiplexing programming examples. Refer to IO<ToolKit>
for additional information on general I/O behaviors of sockets.
Copyright©1994-2026 Recursion
Software LLC
All Rights Reserved - For use by licensed users only.