Classes | Public Member Functions | Private Attributes
FIX::SocketConnector Class Reference

Connects sockets to remote ports and addresses. More...

#include <SocketConnector.h>

Collaboration diagram for FIX::SocketConnector:
Collaboration graph
[legend]

List of all members.

Classes

class  Strategy

Public Member Functions

 SocketConnector (int timeout=0)
int connect (const std::string &address, int port, bool noDelay, int sendBufSize, int rcvBufSize)
int connect (const std::string &address, int port, bool noDelay, int sendBufSize, int rcvBufSize, Strategy &)
void block (Strategy &strategy, bool poll=0, double timeout=0.0)
SocketMonitorgetMonitor ()

Private Attributes

SocketMonitor m_monitor

Detailed Description

Connects sockets to remote ports and addresses.

Definition at line 35 of file SocketConnector.h.


Constructor & Destructor Documentation

Definition at line 82 of file SocketConnector.cpp.

: m_monitor( timeout ) {}

Member Function Documentation

void FIX::SocketConnector::block ( Strategy strategy,
bool  poll = 0,
double  timeout = 0.0 
)

Definition at line 111 of file SocketConnector.cpp.

References FIX::SocketMonitor::block(), and m_monitor.

Referenced by FIX::SocketInitiator::onPoll(), and FIX::SocketInitiator::onStart().

{
  ConnectorWrapper wrapper( *this, strategy );
  m_monitor.block( wrapper, poll, timeout );
}
int FIX::SocketConnector::connect ( const std::string &  address,
int  port,
bool  noDelay,
int  sendBufSize,
int  rcvBufSize 
)

Definition at line 85 of file SocketConnector.cpp.

References FIX::SocketMonitor::addConnect(), m_monitor, FIX::socket_connect(), FIX::socket_createConnector(), and FIX::socket_setsockopt().

Referenced by connect(), and FIX::SocketInitiator::doConnect().

{
  int socket = socket_createConnector();

  if ( socket != -1 )
  {
    if( noDelay )
      socket_setsockopt( socket, TCP_NODELAY );
    if( sendBufSize )
      socket_setsockopt( socket, SO_SNDBUF, sendBufSize );
    if( rcvBufSize )
      socket_setsockopt( socket, SO_RCVBUF, rcvBufSize );
    m_monitor.addConnect( socket );
    socket_connect( socket, address.c_str(), port );
  }
  return socket;
}
int FIX::SocketConnector::connect ( const std::string &  address,
int  port,
bool  noDelay,
int  sendBufSize,
int  rcvBufSize,
Strategy strategy 
)

Definition at line 104 of file SocketConnector.cpp.

References connect().

{
  int socket = connect( address, port, noDelay, sendBufSize, rcvBufSize );
  return socket;
}

Definition at line 47 of file SocketConnector.h.

References m_monitor.

Referenced by FIX::SocketInitiator::doConnect(), and FIX::SocketConnection::read().

{ return m_monitor; }

Member Data Documentation

Definition at line 50 of file SocketConnector.h.

Referenced by block(), connect(), and getMonitor().


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

Generated on Mon Jun 23 2014 23:49:39 for QuickFIX by doxygen 1.7.6.1 written by Dimitri van Heesch, © 1997-2001