eq::net::FDConnection Class Reference

A generic file descriptor-based connection, to be subclassed. More...

#include <fdConnection.h>

Inheritance diagram for eq::net::FDConnection:

Inheritance graph
[legend]
Collaboration diagram for eq::net::FDConnection:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual Notifier getNotifier () const
bool hasData () const

Protected Member Functions

virtual void readNB (void *buffer, const uint64_t bytes)
 Start a read operation on the connection.
virtual int64_t readSync (void *buffer, const uint64_t bytes)
 Finish reading data from the connection.
virtual int64_t write (const void *buffer, const uint64_t bytes)
 Write data to the connection.

Protected Attributes

int _readFD
 The read file descriptor.
int _writeFD
 The write file descriptor.

Friends

std::ostream & operator<< (std::ostream &os, const FDConnection *connection)


Detailed Description

A generic file descriptor-based connection, to be subclassed.

Definition at line 32 of file fdConnection.h.


Member Function Documentation

virtual Notifier eq::net::FDConnection::getNotifier (  )  const [inline, virtual]

Returns:
the notifier signalling events on the connection.

Reimplemented from eq::net::Connection.

Definition at line 36 of file fdConnection.h.

void eq::net::FDConnection::readNB ( void *  buffer,
const uint64_t  bytes 
) [protected, virtual]

Start a read operation on the connection.

This method is the low-level counterpart to recvNB().

This function returns immediately. The operation's Notifier will signal data availability, upon which readSync() should be used to finish the operation.

Parameters:
buffer the buffer receiving the data.
bytes the number of bytes to read.
See also:
readSync()

Implements eq::net::Connection.

Definition at line 44 of file fdConnection.cpp.

int64_t eq::net::FDConnection::readSync ( void *  buffer,
const uint64_t  bytes 
) [protected, virtual]

Finish reading data from the connection.

This method is the low-level counterpart to recvSync(). It may return with a partial read.

Parameters:
buffer the buffer receiving the data.
bytes the number of bytes to read.
Returns:
the number of bytes read, or -1 upon error.

Implements eq::net::Connection.

Definition at line 46 of file fdConnection.cpp.

References _readFD, eq::net::Connection::close(), EQINFO, and EQWARN.

Here is the call graph for this function:

int64_t eq::net::FDConnection::write ( const void *  buffer,
const uint64_t  bytes 
) [protected, virtual]

Write data to the connection.

Parameters:
buffer the buffer containing the message.
bytes the number of bytes to write.
Returns:
the number of bytes written, or -1 upon error.

Implements eq::net::Connection.

Definition at line 76 of file fdConnection.cpp.

References _writeFD, and EQWARN.


The documentation for this class was generated from the following files:
Generated on Mon Aug 10 18:58:44 2009 for Equalizer 0.9 by  doxygen 1.5.8