Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Networking Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

6.1 Introduction

A socket address identifies the endpoint and type of a socket communication channel. A server process binds to an address and a client process connects to the server's address. The Networking package socket address classes enable you to construct and work with socket addresses, even if you do not know their exact type.

6.1.1 The Socket Address Classes

Figure 8 shows the hierarchy of the socket address classes. The classes on the left, derived from RWSockAddrBase, represent the addresses themselves. The classes on the right, derived from RWSockType, represent address types.

Figure 8: Socket address hierarchy

6.1.2 Understanding the Base Class

RWSockAddrBase is the root of the socket address class hierarchy. It is an abstract base class that contains member functions for recognizing and using a socket address. Most of the Networking package interfaces that need a socket address—for example, the interfaces that connect a socket client to a server—include a const RWSockAddrBase& as a parameter. This means that you can use a reference to any of the classes derived from RWSockAddrBase as an argument to these functions.

Because RWSockAddrBase is an abstract class, you cannot instantiate an RWSockAddrBase object directly. Instead you instantiate the appropriate derived class. When you know the address family, you can use an object of the type appropriate to that family.

For example, to create an Internet family address, you would instantiate an RWInetAddr object, as shown below.



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.