ns3::FdReader Class Reference

A class that asynchronously reads from a file descriptor. More...

#include <unix-fd-reader.h>

Inheritance diagram for ns3::FdReader:
Inheritance graph
[legend]
Collaboration diagram for ns3::FdReader:
Collaboration graph
[legend]

List of all members.

Classes

struct  Data

Public Member Functions

void Start (int fd, Callback< void, uint8_t *, ssize_t > readCallback)
void Stop (void)

Protected Member Functions

virtual FdReader::Data DoRead (void)=0

Protected Attributes

int m_fd

Detailed Description

A class that asynchronously reads from a file descriptor.

This class can be used to start a system thread that reads from a given file descriptor and invokes a given callback when data is received. This class handles thread management automatically but the DoRead() method must be implemented by a subclass.


Member Function Documentation

void ns3::FdReader::Start ( int  fd,
Callback< void, uint8_t *, ssize_t >  readCallback 
)

Start a new read thread.

Parameters:
fd A valid file descriptor open for reading.
readCallback A callback to invoke when new data is available.
void ns3::FdReader::Stop ( void   ) 

Stop the read thread and reset internal state. This does not close the file descriptor used for reading.


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

Generated on 6 Jan 2011 for NS-3 by  doxygen 1.6.1