Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

WvTCPConn Class Reference

#include <wvtcp.h>

Inheritance diagram for WvTCPConn:

WvStream WvStream List of all members.

Public Methods

 WvTCPConn (const WvIPPortAddr &_remaddr)
 WvTCPConn (const WvString &_hostname, __u16 _port=0)
virtual ~WvTCPConn ()
void nice_tcpopts ()
void low_delay ()
WvIPPortAddr localaddr ()
virtual const WvIPPortAddrsrc () const
bool isconnected () const
virtual bool pre_select (SelectInfo &si)
virtual bool post_select (SelectInfo &si)
virtual bool isok () const
 WvTCPConn (const WvIPPortAddr &_remaddr)
 WvTCPConn (const WvString &_hostname, __u16 _port=0)
virtual ~WvTCPConn ()
void nice_tcpopts ()
void low_delay ()
WvIPPortAddr localaddr ()
virtual const WvIPPortAddrsrc () const
bool isconnected () const
virtual bool pre_select (SelectInfo &si)
virtual bool post_select (SelectInfo &si)
virtual bool isok () const

Protected Methods

 WvTCPConn (int _fd, const WvIPPortAddr &_remaddr)
void do_connect ()
void check_resolver ()
 WvTCPConn (int _fd, const WvIPPortAddr &_remaddr)
void do_connect ()
void check_resolver ()

Protected Attributes

bool resolved
bool connected
WvString hostname
WvIPPortAddr remaddr
WvResolver dns

Friends

class WvTCPListener

Detailed Description

WvTCPConn tries to make all outgoing connections asynchronously (in the background). You can tell the connection has been established when a select() call returns 'true' with writable==true.

Definition at line 28 of file include/wvtcp.h.


Constructor & Destructor Documentation

WvTCPConn::WvTCPConn int    _fd,
const WvIPPortAddr   _remaddr
[protected]
 

Start a WvTCPConn on an already-open socket (used by WvTCPListener)

Definition at line 27 of file wvtcp.cc.

References connected, WvStream::getfd(), nice_tcpopts(), remaddr, resolved, and WvStream::seterr().

WvTCPConn::WvTCPConn const WvIPPortAddr   _remaddr
 

WvTCPConn tries to make all outgoing connections asynchronously (in the background). You can tell the connection has been established when a select() call returns 'true' with writable==true.

Definition at line 17 of file wvtcp.cc.

References connected, do_connect(), remaddr, and resolved.

WvTCPConn::WvTCPConn const WvString   _hostname,
__u16    _port = 0
 

Resolve the hostname, then connect a new socket

Definition at line 41 of file wvtcp.cc.

References connected, dns, do_connect(), WvString::edit(), WvResolver::findaddr(), hostname, WvIPPortAddr::port, remaddr, and resolved.

WvTCPConn::~WvTCPConn   [virtual]
 

Destructor - rarely do you need to call this - close() is a much better way to tear down a TCP Stream ;)

Definition at line 74 of file wvtcp.cc.

WvTCPConn::WvTCPConn int    _fd,
const WvIPPortAddr   _remaddr
[protected]
 

Start a WvTCPConn on an already-open socket (used by WvTCPListener)

WvTCPConn::WvTCPConn const WvIPPortAddr   _remaddr
 

WvTCPConn tries to make all outgoing connections asynchronously (in the background). You can tell the connection has been established when a select() call returns 'true' with writable==true.

WvTCPConn::WvTCPConn const WvString   _hostname,
__u16    _port = 0
 

Resolve the hostname, then connect a new socket

virtual WvTCPConn::~WvTCPConn   [virtual]
 

Destructor - rarely do you need to call this - close() is a much better way to tear down a TCP Stream ;)


Member Function Documentation

void WvTCPConn::check_resolver   [protected]
 

Resolve the remote address, if it was fed in non-IP form

void WvTCPConn::check_resolver   [protected]
 

Resolve the remote address, if it was fed in non-IP form

Definition at line 130 of file wvtcp.cc.

References dns, do_connect(), WvResolver::findaddr(), hostname, WvIPPortAddr::port, remaddr, resolved, and WvStream::seterr().

Referenced by post_select(), and pre_select().

void WvTCPConn::do_connect   [protected]
 

Connect to the remote end - note the "Protected" above ;)

void WvTCPConn::do_connect   [protected]
 

Connect to the remote end - note the "Protected" above ;)

Definition at line 104 of file wvtcp.cc.

References WvStream::getfd(), nice_tcpopts(), remaddr, WvStream::rwfd, WvStream::seterr(), WvIPPortAddr::sockaddr(), and WvIPAddr::sockaddr_len().

Referenced by check_resolver(), and WvTCPConn().

bool WvTCPConn::isconnected   const [inline]
 

has the connection been completed yet?

Definition at line 99 of file ipstreams/wvtcp.h.

References connected.

bool WvTCPConn::isconnected   const [inline]
 

has the connection been completed yet?

Definition at line 99 of file include/wvtcp.h.

References connected.

Referenced by pre_select(), and WvHTTPStream::pre_select().

virtual bool WvTCPConn::isok   const [virtual]
 

Is this connection OK? Note: isok() will always be true if !resolved, even though fd==-1.

Reimplemented from WvStream.

bool WvTCPConn::isok   const [virtual]
 

Is this connection OK? Note: isok() will always be true if !resolved, even though fd==-1.

Reimplemented from WvStream.

Definition at line 230 of file wvtcp.cc.

References WvStream::isok(), and resolved.

Referenced by localaddr(), and pre_select().

WvIPPortAddr WvTCPConn::localaddr  
 

the local address of this socket (ie. from getsockname()) really useful only for transparent proxies, but always available. may be 0.0.0.0 if we did not bind explicitly!

WvIPPortAddr WvTCPConn::localaddr  
 

the local address of this socket (ie. from getsockname()) really useful only for transparent proxies, but always available. may be 0.0.0.0 if we did not bind explicitly!

Definition at line 153 of file wvtcp.cc.

References WvStream::getfd(), isok(), and SO_ORIGINAL_DST.

void WvTCPConn::low_delay  
 

function to set up a TCP socket the way we like In addition to the nice_tcpopts(), set TCP_NODELAY

void WvTCPConn::low_delay  
 

function to set up a TCP socket the way we like In addition to the nice_tcpopts(), set TCP_NODELAY

Definition at line 92 of file wvtcp.cc.

References WvStream::getfd().

void WvTCPConn::nice_tcpopts  
 

function to set up a TCP socket the way we like (Read/Write, Non-Blocking, KeepAlive)

void WvTCPConn::nice_tcpopts  
 

function to set up a TCP socket the way we like (Read/Write, Non-Blocking, KeepAlive)

Definition at line 82 of file wvtcp.cc.

References WvStream::getfd().

Referenced by do_connect(), and WvTCPConn().

virtual bool WvTCPConn::post_select SelectInfo &    si [virtual]
 

override post_select() to set the 'connected' variable as soon as we are connected.

Reimplemented from WvStream.

bool WvTCPConn::post_select SelectInfo &    si [virtual]
 

override post_select() to set the 'connected' variable as soon as we are connected.

Reimplemented from WvStream.

Definition at line 197 of file wvtcp.cc.

References check_resolver(), connected, WvStream::getfd(), WvStream::post_select(), remaddr, resolved, WvStream::seterr(), WvIPPortAddr::sockaddr(), and WvIPAddr::sockaddr_len().

virtual bool WvTCPConn::pre_select SelectInfo &    si [virtual]
 

override pre_select() to cause select() results when resolving names.

Reimplemented from WvStream.

bool WvTCPConn::pre_select SelectInfo &    si [virtual]
 

override pre_select() to cause select() results when resolving names.

Reimplemented from WvStream.

Definition at line 177 of file wvtcp.cc.

References check_resolver(), dns, hostname, isconnected(), isok(), WvStream::pre_select(), WvResolver::pre_select(), and resolved.

virtual const WvIPPortAddr* WvTCPConn::src   const [virtual]
 

return the remote address (source of all incoming packets), which is a constant for any given TCP connection.

Reimplemented from WvStream.

const WvIPPortAddr * WvTCPConn::src   const [virtual]
 

return the remote address (source of all incoming packets), which is a constant for any given TCP connection.

Reimplemented from WvStream.

Definition at line 171 of file wvtcp.cc.

References remaddr.


Friends And Related Function Documentation

WvTCPListener [friend]
 

Definition at line 30 of file include/wvtcp.h.


Member Data Documentation

bool WvTCPConn::connected [protected]
 

Definition at line 32 of file ipstreams/wvtcp.h.

Referenced by isconnected(), post_select(), and WvTCPConn().

WvResolver WvTCPConn::dns [protected]
 

Definition at line 35 of file ipstreams/wvtcp.h.

Referenced by check_resolver(), pre_select(), and WvTCPConn().

WvString WvTCPConn::hostname [protected]
 

Definition at line 33 of file ipstreams/wvtcp.h.

Referenced by check_resolver(), pre_select(), and WvTCPConn().

WvIPPortAddr WvTCPConn::remaddr [protected]
 

Definition at line 34 of file ipstreams/wvtcp.h.

Referenced by check_resolver(), do_connect(), post_select(), src(), and WvTCPConn().

bool WvTCPConn::resolved [protected]
 

Definition at line 32 of file ipstreams/wvtcp.h.

Referenced by check_resolver(), isok(), post_select(), pre_select(), and WvTCPConn().


The documentation for this class was generated from the following files:
Generated on Sat Aug 24 23:08:06 2002 for WvStreams by doxygen1.2.15