Kea  1.9.9-git
isc::asiodns::IOFetchData Struct Reference

IOFetch Data. More...

Public Member Functions

 IOFetchData (IOFetch::Protocol proto, IOService &service, const IOAddress &address, uint16_t port, OutputBufferPtr &buff, IOFetch::Callback *cb, int wait)
 Constructor. More...
bool responseOK ()

Public Attributes

 Called on I/O Completion. More...
size_t cumulative
 Cumulative received amount. More...
size_t expected
 Expected amount of data. More...
OutputBufferPtr msgbuf
 Wire buffer for question. More...
size_t offset
 Offset to receive data. More...
isc::log::MessageID origin
 Origin of last asynchronous I/O. More...
bool packet
 true if packet was supplied More...
IOFetch::Protocol protocol
 Protocol being used. More...
isc::dns::qid_t qid
 The QID set in the query. More...
OutputBufferPtr received
 Received data put here. More...
boost::scoped_ptr< IOEndpointremote_rcv
 Where the response came from. More...
boost::scoped_ptr< IOEndpointremote_snd
 Where the fetch is sent. More...
boost::scoped_ptr< IOAsioSocket< IOFetch > > socket
 Socket to use for I/O. More...
uint8_t staging [IOFetch::STAGING_LENGTH]
 Temporary array for received data. More...
bool stopped
 Have we stopped running? More...
int timeout
 Timeout in ms. More...
boost::asio::deadline_timer timer
 Timer to measure timeouts. More...

Detailed Description

IOFetch Data.

The data for IOFetch is held in a separate struct pointed to by a shared_ptr object. This is because the IOFetch object will be copied often (it is used as a coroutine and passed as callback to many async_*() functions) and we want keep the same data). Organising the data in this way keeps copying to a minimum.

Definition at line 58 of file

Constructor & Destructor Documentation

isc::asiodns::IOFetchData::IOFetchData ( IOFetch::Protocol  proto,
IOService service,
const IOAddress address,
uint16_t  port,
OutputBufferPtr buff,
IOFetch::Callback cb,
int  wait 


Just fills in the data members of the IOFetchData structure

protoEither IOFetch::TCP or IOFetch::UDP.
serviceI/O Service object to handle the asynchronous operations.
addressIP address of upstream server
portPort to use for the query
buffOutput buffer into which the response (in wire format) is written (if a response is received).
cbCallback object containing the callback to be called when we terminate. The caller is responsible for managing this object and deleting it if necessary.
waitTimeout for the fetch (in ms).

TODO: May need to alter constructor (see comment 4 in Trac ticket #554)

Definition at line 107 of file

Member Function Documentation

bool isc::asiodns::IOFetchData::responseOK ( )

Definition at line 148 of file

References isc::util::readUint16().

+ Here is the call graph for this function:

Member Data Documentation

IOFetch::Callback* isc::asiodns::IOFetchData::callback

Called on I/O Completion.

Definition at line 70 of file

size_t isc::asiodns::IOFetchData::cumulative

Cumulative received amount.

Definition at line 73 of file

size_t isc::asiodns::IOFetchData::expected

Expected amount of data.

Definition at line 74 of file

OutputBufferPtr isc::asiodns::IOFetchData::msgbuf

Wire buffer for question.

Definition at line 68 of file

size_t isc::asiodns::IOFetchData::offset

Offset to receive data.

Definition at line 75 of file

isc::log::MessageID isc::asiodns::IOFetchData::origin

Origin of last asynchronous I/O.

Definition at line 85 of file

bool isc::asiodns::IOFetchData::packet

true if packet was supplied

Definition at line 78 of file

IOFetch::Protocol isc::asiodns::IOFetchData::protocol

Protocol being used.

Definition at line 72 of file

isc::dns::qid_t isc::asiodns::IOFetchData::qid

The QID set in the query.

Definition at line 88 of file

OutputBufferPtr isc::asiodns::IOFetchData::received

Received data put here.

Definition at line 69 of file

boost::scoped_ptr<IOEndpoint> isc::asiodns::IOFetchData::remote_rcv

Where the response came from.

Definition at line 67 of file

boost::scoped_ptr<IOEndpoint> isc::asiodns::IOFetchData::remote_snd

Where the fetch is sent.

Definition at line 66 of file

boost::scoped_ptr<IOAsioSocket<IOFetch> > isc::asiodns::IOFetchData::socket

Socket to use for I/O.

Definition at line 64 of file

uint8_t isc::asiodns::IOFetchData::staging[IOFetch::STAGING_LENGTH]

Temporary array for received data.

Definition at line 86 of file

bool isc::asiodns::IOFetchData::stopped

Have we stopped running?

Definition at line 76 of file

int isc::asiodns::IOFetchData::timeout

Timeout in ms.

Definition at line 77 of file

boost::asio::deadline_timer isc::asiodns::IOFetchData::timer

Timer to measure timeouts.

Definition at line 71 of file

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