286 virtual void close() = 0;
319 return (io_pending_);
329 void setListening(
bool value) {
340 RequestReceiveHandler& recv_handler_;
631 virtual void close() = 0;
680 return ((ncr_to_send_) ?
true :
false);
685 return (send_queue_max_);
700 return (send_queue_.size());
740 return (send_queue_);
750 void setSending(
bool value) {
758 RequestSendHandler& send_handler_;
761 size_t send_queue_max_;
bool amSending() const
Returns true if the sender is in send mode, false otherwise.
virtual ~RequestReceiveHandler()
Exception thrown if an error occurs initiating an IO receive.
NcrSenderSendError(const char *file, size_t line, const char *what)
bool amListening() const
Returns true if the listener is listening, false otherwise.
Exception thrown if an error occurs initiating an IO send.
NcrSenderOpenError(const char *file, size_t line, const char *what)
NameChangeProtocol stringToNcrProtocol(const std::string &protocol_str)
Function which converts labels to NameChangeProtocol enum values.
virtual ~RequestSendHandler()
virtual void close()=0
Abstract method which closes the IO source.
virtual bool ioReady()=0
Returns whether or not the sender has IO ready to process.
virtual int getSelectFd()=0
Returns a file descriptor suitable for use with select.
NcrListenerOpenError(const char *file, size_t line, const char *what)
NcrListenerError(const char *file, size_t line, const char *what)
void assumeQueue(NameChangeSender &source_sender)
Move all queued requests from a given sender into the send queue.
Result
Defines the outcome of an asynchronous NCR send.
boost::shared_ptr< NameChangeListener > NameChangeListenerPtr
Defines a smart pointer to an instance of a listener.
void skipNext()
Removes the request at the front of the send queue.
size_t getQueueSize() const
Returns the number of entries currently in the send queue.
boost::shared_ptr< NameChangeRequest > NameChangeRequestPtr
Defines a pointer to a NameChangeRequest.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
The IOService class is a wrapper for the ASIO io_service class.
Thrown when a NameChangeSender encounters an error.
Exception thrown if an NcrListenerError encounters a general error.
SendQueue & getSendQueue()
Returns a reference to the send queue.
std::string ncrProtocolToString(NameChangeProtocol protocol)
Function which converts NameChangeProtocol enums to text labels.
void clearSendQueue()
Flushes all entries in the send queue.
NameChangeListener(RequestReceiveHandler &recv_handler)
Constructor.
Exception thrown if an error occurs during IO source open.
const NameChangeRequestPtr & peekAt(const size_t index) const
Returns the entry at a given position in the queue.
NcrListenerReceiveError(const char *file, size_t line, const char *what)
NameChangeSender(RequestSendHandler &send_handler, size_t send_queue_max=MAX_QUEUE_DEFAULT)
Constructor.
boost::shared_ptr< NameChangeSender > NameChangeSenderPtr
Defines a smart pointer to an instance of a sender.
Abstract class for defining application layer send callbacks.
void startListening(isc::asiolink::IOService &io_service)
Prepares the IO for reception and initiates the first receive.
size_t getQueueMaxSize() const
Returns the maximum number of entries allowed in the send queue.
virtual void open(isc::asiolink::IOService &io_service)=0
Abstract method which opens the IO sink for transmission.
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
void receiveNext()
Initiates an asynchronous receive.
NcrSenderQueueFull(const char *file, size_t line, const char *what)
virtual void doSend(NameChangeRequestPtr &ncr)=0
Initiates an IO layer asynchronous send.
virtual void runReadyIO()
Processes sender IO events.
void stopSending()
Closes the IO sink and stops send logic.
virtual void open(isc::asiolink::IOService &io_service)=0
Abstract method which opens the IO source for reception.
void startSending(isc::asiolink::IOService &io_service)
Prepares the IO for transmission.
NcrSenderError(const char *file, size_t line, const char *what)
virtual void operator()(const Result result, NameChangeRequestPtr &ncr)=0
Function operator implementing a NCR send callback.
Exception thrown if an error occurs initiating an IO send.
bool isSendInProgress() const
Returns true when a send is in progress.
void sendNext()
Dequeues and sends the next request on the send queue.
NameChangeProtocol
Defines the list of socket protocols supported.
void setQueueMaxSize(const size_t new_max)
Sets the maximum queue size to the given value.
virtual void operator()(const Result result, NameChangeRequestPtr &ncr)=0
Function operator implementing a NCR receive callback.
virtual ~NameChangeListener()
Destructor.
std::deque< NameChangeRequestPtr > SendQueue
Defines the type used for the request send queue.
bool isIoPending() const
Returns true if the listener has an IO call in progress.
Abstract interface for sending NameChangeRequests.
void invokeRecvHandler(const Result result, NameChangeRequestPtr &ncr)
Calls the NCR receive handler registered with the listener.
void sendRequest(NameChangeRequestPtr &ncr)
Queues the given request to be sent.
void stopListening()
Closes the IO source and stops listen logic.
virtual ~NameChangeSender()
Destructor.
void invokeSendHandler(const NameChangeSender::Result result)
Calls the NCR send completion handler registered with the sender.
This file provides the classes needed to embody, compose, and decompose DNS update requests that are ...
virtual void close()=0
Abstract method which closes the IO sink.
Abstract interface for receiving NameChangeRequests.
Abstract class for defining application layer receive callbacks.
virtual void doReceive()=0
Initiates an IO layer asynchronous read.
static const size_t MAX_QUEUE_DEFAULT
Defines a default maximum number of entries in the send queue.
Result
Defines the outcome of an asynchronous NCR receive.
Exception thrown if an error occurs during IO source open.