temporary conditional compile directives.
}
void
-#if 0
-NameChangeListener::invokeRecvHandler(Result result, NameChangeRequestPtr ncr) {
-#else
-NameChangeListener::invokeRecvHandler(const Result result,
+NameChangeListener::invokeRecvHandler(const Result result,
NameChangeRequestPtr& ncr) {
-#endif
// Call the registered application layer handler.
recv_handler_(result, ncr);
// close the window by invoking the application handler with
// a failed result, and let the application layer sort it out.
LOG_ERROR(dctl_logger, DHCP_DDNS_NCR_RECV_NEXT).arg(ex.what());
-#if 0
- recv_handler_(ERROR, NameChangeRequestPtr());
-#else
NameChangeRequestPtr empty;
recv_handler_(ERROR, empty);
-#endif
}
}
}
/// data being transmitted. In other words, it doesn't know beans about
/// NCRs.
///
-/// The abstract classes defined here implement the latter, middle layer,
+/// The abstract classes defined here implement the latter, middle layer,
/// the NameChangeRequest layer. There are two types of participants in this
/// middle ground:
///
/// result is NameChangeListener::SUCCESS. It is indeterminate other
/// wise.
/// @throw This method MUST NOT throw.
- virtual void operator ()(const Result result,
+ virtual void operator ()(const Result result,
NameChangeRequestPtr& ncr) = 0;
};
/// at application level and should trap and handle any errors at
/// that level, rather than throw exceptions. If an error has occurred
/// prior to invoking the handler, it will be expressed in terms a failed
- /// result being passed to the handler, not a throw. Therefore any
- /// exceptions at the handler level are application issues and should be
+ /// result being passed to the handler, not a throw. Therefore any
+ /// exceptions at the handler level are application issues and should be
/// dealt with at that level.
///
- /// If the handler were to throw, the exception will surface at
- /// IOService::run (or run variant) method invocation as this occurs as
- /// part of the callback chain. This will cause the invocation of
- /// doReceive to be skipped which will break the listen-receive-listen
- /// cycle. To restart the cycle it would be necessary to call
+ /// If the handler were to throw, the exception will surface at
+ /// IOService::run (or run variant) method invocation as this occurs as
+ /// part of the callback chain. This will cause the invocation of
+ /// doReceive to be skipped which will break the listen-receive-listen
+ /// cycle. To restart the cycle it would be necessary to call
/// stopListener() and then startListener().
///
/// @param result contains that receive outcome status.
/// handler level are application issues and should be dealt with at that
/// level.
///
- /// If the handler were to throw, the exception will surface at
- /// IOService::run (or run variant) method invocation as this occurs as
- /// part of the callback chain. This will cause the invocation of
- /// sendNext to be skipped which will interrupt automatic buffer drain
+ /// If the handler were to throw, the exception will surface at
+ /// IOService::run (or run variant) method invocation as this occurs as
+ /// part of the callback chain. This will cause the invocation of
+ /// sendNext to be skipped which will interrupt automatic buffer drain
/// cycle. Assuming there is not a connectivity issue, the cycle will
/// resume with the next sendRequest call, or an explicit call to sendNext.
///
///
/// This method can be used to discard all of the NCRs currently in the
/// the send queue. Note it may not be called while the sender is in
- /// the sending state.
+ /// the sending state.
/// @throw throws NcrSenderError if called and sender is in sending state.
void clearSendQueue();
//*************************** NameChangeUDPListener ***********************
NameChangeUDPListener::
-NameChangeUDPListener(const isc::asiolink::IOAddress& ip_address,
- const uint32_t port, NameChangeFormat format,
+NameChangeUDPListener(const isc::asiolink::IOAddress& ip_address,
+ const uint32_t port, NameChangeFormat format,
RequestReceiveHandler& ncr_recv_handler,
const bool reuse_address)
: NameChangeListener(ncr_recv_handler), ip_address_(ip_address),
// Instantiate the receive callback. This gets passed into each receive.
// Note that the callback constructor is passed an instance method
// pointer to our recv_completion_handler.
- recv_callback_.reset(new
+ recv_callback_.reset(new
UDPCallback(RawBufferPtr(new uint8_t[RECV_BUF_MAX]),
RECV_BUF_MAX,
- UDPEndpointPtr(new
+ UDPEndpointPtr(new
asiolink::UDPEndpoint()),
boost::bind(&NameChangeUDPListener::
recv_completion_handler, this, _1, _2)));
/// @brief A NOP derivation for constructor test purposes.
class SimpleListenHandler : public NameChangeListener::RequestReceiveHandler {
public:
- virtual void operator ()(const NameChangeListener::Result,
+ virtual void operator ()(const NameChangeListener::Result,
NameChangeRequestPtr&) {
}
};
/// @brief A NOP derivation for constructor test purposes.
class SimpleSendHandler : public NameChangeSender::RequestSendHandler {
public:
- virtual void operator ()(const NameChangeSender::Result,
+ virtual void operator ()(const NameChangeSender::Result,
NameChangeRequestPtr&) {
}
};
/// This test verifies that:
/// 1. Constructing with a max queue size of 0 is not allowed
/// 2. Given valid parameters, the sender constructor works
-/// 3. Default construction provides default max queue size
+/// 3. Default construction provides default max queue size
/// 4. Construction with a custom max queue size works
TEST(NameChangeUDPSenderBasicTest, constructionTests) {
isc::asiolink::IOAddress ip_address(TEST_ADDRESS);