2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-05 08:25:16 +00:00

[trac554] First stage of adding protocol-dependent upstream fetch

Admin tasks:
* Split out io_error.h from asiolink.h
* Made test files follow naming convention of main files
* More discriminatory includes in some files
* Updates tests/Makefile.am

Coding tasks:
* Add additional methods to io_socket.* and put in dummies in
  {tcp,udp}_socket.h
* Incorporated basic IO Fetch code from Scott
This commit is contained in:
Stephen Morris
2011-02-14 19:26:09 +00:00
parent bbb0031f3a
commit e01aeb058b
18 changed files with 770 additions and 296 deletions

View File

@@ -40,6 +40,56 @@ public:
virtual int getNative() const { return (socket_.native()); }
virtual int getProtocol() const { return (IPPROTO_UDP); }
/// \brief Open Socket
///
/// No-op for UDP sockets
///
/// \param endpoint Unused.
/// \param callback Unused.
///
/// \return false to indicate that the "operation" completed synchronously.
virtual bool open(const IOEndpoint*, IOCompletionCallback&) {
return false;
}
/// \brief Send Asynchronously
///
/// This corresponds to async_send_to() for UDP sockets and async_send()
/// for TCP. In both cases an endpoint argument is supplied indicating the
/// target of the send - this is ignored for TCP.
///
/// \param data Data to send
/// \param length Length of data to send
/// \param endpoint Target of the send
/// \param callback Callback object.
virtual void async_send(const void*, size_t,
const IOEndpoint*, IOCompletionCallback&) {
}
/// \brief Receive Asynchronously
///
/// This correstponds to async_receive_from() for UDP sockets and
/// async_receive() for TCP. In both cases, an endpoint argument is
/// supplied to receive the source of the communication. For TCP it will
/// be filled in with details of the connection.
///
/// \param data Buffer to receive incoming message
/// \param length Length of the data buffer
/// \param endpoint Source of the communication
/// \param callback Callback object
virtual void async_receive(void* data, size_t, IOEndpoint*,
IOCompletionCallback&) {
}
/// \brief Cancel I/O On Socket
virtual void cancel() {
}
/// \brief Close socket
virtual void close() {
}
private:
asio::ip::udp::socket& socket_;
};