Commit 725aa66b authored by Scott Mann's avatar Scott Mann
Browse files

[trac554] Added dual socket support

          Now both tcp and udp are supported in IOFetch
parent 74e4f864
......@@ -581,7 +581,8 @@ public:
InputBuffer ibuf(buffer_->getData(), buffer_->getLength());
incoming.fromWire(ibuf);
if (message->getHeaderFlag(Message::HEADERFLAG_TC) {
if (incoming.getHeaderFlag(Message::HEADERFLAG_TC)) {
//truncate bit is set, so retry via tcp
}
......
......@@ -91,9 +91,7 @@ struct IOFetch::IOFetchProtocol {
callback(c),
stopped(false),
timer(service)
{
}
{ }
};
......@@ -101,15 +99,17 @@ struct IOFetch::IOFetchProtocol {
/// The following functions implement the \c IOFetch class.
///
/// The constructor
IOFetch::IOFetch(io_service& io_service,
const Question& q, const IOAddress& addr, uint16_t port,
OutputBufferPtr buffer, Callback *callback, int timeout) :
IOFetch::IOFetch(io_service& io_service, const Question& q,
const IOAddress& addr, uint16_t port,
OutputBufferPtr buffer, Callback *callback, int timeout) :
data_(new IOFetchProtocol(io_service,
addr.getFamily() == AF_INET ? udp::v4() : udp::v6(),
addr.getFamily() == AF_INET ? tcp::v4() : tcp::v6(),
q, buffer,
callback))
{
data_->tremote = TCPEndpoint(addr, port).getASIOEndpoint();
data_->remote = UDPEndpoint(addr, port).getASIOEndpoint();
data_->timeout = timeout;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment