C++ Portable Types Library (PTypes) Version 1.7

Top: Networking

PTypes' networking module provides simple means of creating both client and server applications communicating over a IP network. The networking classes and utilities are built on top of BSD sockets and WinSock2 frameworks. PTypes not only solves and hides all incompatibility issues between these two API's, but also makes the task of creating networking applications even simpler.

Building client/server applications requires you to either use an existing protocol (such like HTTP, FTP, SMTP) or develop your own high-level communication protocol for your specific needs. Since the latter may be a nontrivial task, to avoid logical mistakes in the communication process we recommend you, first of all, to study some of the widely used protocols, and second, use one of the existing protocols with possible modifications instead of creating new ones. For example, HTTP (Hypertext Transfer Protocol) used by web servers and browsers was designed to be as generic as possible, so that it can be used virtually for any task with simple request-response logic.

A real-world example of using PTypes networking is included in the source code (See wshare).

The networking classes and utilities are declared in <pinet.h>.

PTypes home