Vault  4.1
Public Member Functions | Protected Attributes
VSocketConnectionStrategy Class Reference

A socket connection strategy determines how to connect a socket in the face of DNS resolution, when an IP may resolve to more than one IP address. More...

#include <vsocket.h>

Inheritance diagram for VSocketConnectionStrategy:
VSocketConnectionStrategyLinear VSocketConnectionStrategySingle VSocketConnectionStrategyThreaded

List of all members.

Public Member Functions

virtual void connect (const VString &hostName, int portNumber, VSocket &socketToConnect) const =0
 The VSocketConnectionStrategy interface to be implemented by concrete subclasses.
void injectDebugIPAddresses (const VStringVector debugIPAddresses)

Protected Attributes

VStringVector mDebugIPAddresses
 If non-empty, use instead of resolving hostName in connect().

Detailed Description

A socket connection strategy determines how to connect a socket in the face of DNS resolution, when an IP may resolve to more than one IP address.

Provided concrete classes handle single, multiple+synchronous, and multiple+multithreaded approaches.

Definition at line 565 of file vsocket.h.


Member Function Documentation

virtual void VSocketConnectionStrategy::connect ( const VString hostName,
int  portNumber,
VSocket socketToConnect 
) const [pure virtual]

The VSocketConnectionStrategy interface to be implemented by concrete subclasses.

Connects to the host name by resolving it and then applying the strategy to the resolved IP addresses. If the strategy fails (for whatever reason, be it a connect failure or a timeout) it shall throw a VException.

Parameters:
hostNamethe name to resolve and connect to
portNumberthe port number to connect to
socketToConnectif successful, this Vault socket object is to be mutated upon return to have the connected socket's host IP address and low-level VSocketID; for simple non-threaded strategies it is acceptable to simply call this object's connectToIPAddress() and leave the results in place if successful

Implemented in VSocketConnectionStrategyThreaded, VSocketConnectionStrategyLinear, and VSocketConnectionStrategySingle.


The documentation for this class was generated from the following file:

Copyright ©1997-2014 Trygve Isaacson. All rights reserved. This documentation was generated with Doxygen.