Chapter 28 Communications

28.1 About Communications

The Communications functions provide a single interface that may be used to work with a variety of communications resources. A communications resource is a physical or logical device that provides a single bidirectional asynchronous data stream, such as a serial port, parallel port, modem, FAX machine, etc. For each communications resource, there is a service provider with which the application will interface. A service provider consists of a library or driver that provides access to one or more resources.

The File IO functions provide the basic interface for open, close, read, and write operations to communications resources. CreateFile is used to open a handle to a communications resource; and CloseHandle may be used to close the handle. The handle returned by CreateFile may be used in any of the Comm functions to access the resource. It may also be inherited by child processes. ReadFile and WriteFile are used for read and write operations respectively.

The Communications functions have a basic set of functions that provide an interface appropriate for serial communications. A set of extended functions are available for providers that have functionality not supported by the standard functions. This extended set allows you to configure a provider using parameters peculiar to that provider, as well as to invoke provider-specific functions.