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: ...@@ -581,7 +581,8 @@ public:
InputBuffer ibuf(buffer_->getData(), buffer_->getLength()); InputBuffer ibuf(buffer_->getData(), buffer_->getLength());
incoming.fromWire(ibuf); 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 { ...@@ -91,9 +91,7 @@ struct IOFetch::IOFetchProtocol {
callback(c), callback(c),
stopped(false), stopped(false),
timer(service) timer(service)
{ { }
}
}; };
...@@ -101,15 +99,17 @@ struct IOFetch::IOFetchProtocol { ...@@ -101,15 +99,17 @@ struct IOFetch::IOFetchProtocol {
/// The following functions implement the \c IOFetch class. /// The following functions implement the \c IOFetch class.
/// ///
/// The constructor /// The constructor
IOFetch::IOFetch(io_service& io_service, IOFetch::IOFetch(io_service& io_service, const Question& q,
const Question& q, const IOAddress& addr, uint16_t port, const IOAddress& addr, uint16_t port,
OutputBufferPtr buffer, Callback *callback, int timeout) : OutputBufferPtr buffer, Callback *callback, int timeout) :
data_(new IOFetchProtocol(io_service, data_(new IOFetchProtocol(io_service,
addr.getFamily() == AF_INET ? udp::v4() : udp::v6(), addr.getFamily() == AF_INET ? udp::v4() : udp::v6(),
addr.getFamily() == AF_INET ? tcp::v4() : tcp::v6(), addr.getFamily() == AF_INET ? tcp::v4() : tcp::v6(),
q, buffer, q, buffer,
callback)) callback))
{ {
data_->tremote = TCPEndpoint(addr, port).getASIOEndpoint();
data_->remote = UDPEndpoint(addr, port).getASIOEndpoint(); data_->remote = UDPEndpoint(addr, port).getASIOEndpoint();
data_->timeout = timeout; 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