oasys::TCPClient Class Reference

#include <TCPClient.h>

Inheritance diagram for oasys::TCPClient:

oasys::IPClient oasys::IPSocket oasys::IOClient oasys::Logger oasys::IOHandlerBase oasys::IOHandlerBase dtn::APIClient oasys::SMTPClient List of all members.

Detailed Description

Wrapper class for a tcp client socket.

Definition at line 28 of file TCPClient.h.

Public Member Functions

 TCPClient (const char *logbase="/oasys/tcpclient", bool init_socket_immediately=false)
 TCPClient (int fd, in_addr_t remote_addr, u_int16_t remote_port, const char *logbase="/oasys/tcpclient")
virtual int timeout_connect (in_addr_t remote_attr, u_int16_t remote_port, int timeout_ms, int *errp=0)
 Try to connect to the remote host, but don't block for more than timeout milliseconds.

Protected Member Functions

int internal_connect (in_addr_t remote_attr, u_int16_t remote_port)

Private Member Functions

 TCPClient (const TCPClient &)
 Prohibited constructor.


Constructor & Destructor Documentation

oasys::TCPClient::TCPClient ( const TCPClient  )  [private]

Prohibited constructor.

oasys::TCPClient::TCPClient ( const char *  logbase = "/oasys/tcpclient",
bool  init_socket_immediately = false 
)

Definition at line 28 of file TCPClient.cc.

References ASSERT, oasys::IPSocket::fd_, and oasys::IPSocket::init_socket().

oasys::TCPClient::TCPClient ( int  fd,
in_addr_t  remote_addr,
u_int16_t  remote_port,
const char *  logbase = "/oasys/tcpclient" 
)

Definition at line 37 of file TCPClient.cc.


Member Function Documentation

int oasys::TCPClient::timeout_connect ( in_addr_t  remote_attr,
u_int16_t  remote_port,
int  timeout_ms,
int *  errp = 0 
) [virtual]

Try to connect to the remote host, but don't block for more than timeout milliseconds.

If there was an error (either immediate or delayed), return it in *errp.

Returns:
0 on success, IOERROR on error, and IOTIMEOUT on timeout.

Definition at line 44 of file TCPClient.cc.

References ASSERT, oasys::IO::CONNECT, oasys::IPSocket::connect(), errno, oasys::IPSocket::ESTABLISHED, oasys::IPSocket::fd_, oasys::IOHandlerBase::get_notifier(), oasys::IPSocket::init_socket(), oasys::IOERROR, oasys::IOTIMEOUT, log_debug, log_err, oasys::Logger::logpath_, oasys::IOHandlerBase::monitor(), oasys::IO::poll_single(), oasys::IO::set_nonblocking(), oasys::IPSocket::set_state(), and oasys::IPSocket::state_.

int oasys::TCPClient::internal_connect ( in_addr_t  remote_attr,
u_int16_t  remote_port 
) [protected]


The documentation for this class was generated from the following files:
Generated on Thu Jun 7 16:57:00 2007 for DTN Reference Implementation by  doxygen 1.5.1