Kea  2.1.7-git
isc::asiolink::DummyAsioSocket< C > Class Template Reference

The DummyAsioSocket class is a concrete derived class of IOAsioSocket that is not associated with any real socket. More...

#include <io_asio_socket.h>

+ Inheritance diagram for isc::asiolink::DummyAsioSocket< C >:

Public Member Functions

 DummyAsioSocket (const int protocol)
 Constructor from the protocol number. More...
 
virtual void asyncReceive (void *, size_t, size_t, IOEndpoint *, C &)
 Receive Asynchronously. More...
 
virtual void asyncSend (const void *, size_t, const IOEndpoint *, C &)
 Send Asynchronously. More...
 
virtual void cancel ()
 Cancel I/O On AsioSocket. More...
 
virtual void close ()
 Close socket. More...
 
virtual int getNative () const
 A dummy derived method of IOAsioSocket::getNative(). More...
 
virtual int getProtocol () const
 A dummy derived method of IOAsioSocket::getProtocol(). More...
 
bool isOpenSynchronous () const
 Is socket opening synchronous? More...
 
virtual bool open (const IOEndpoint *, C &)
 Open AsioSocket. More...
 
virtual bool receiveComplete (const void *, size_t, size_t &, size_t &, size_t &, isc::util::OutputBufferPtr &)
 Checks if the data received is complete. More...
 

Additional Inherited Members

Detailed Description

template<typename C>
class isc::asiolink::DummyAsioSocket< C >

The DummyAsioSocket class is a concrete derived class of IOAsioSocket that is not associated with any real socket.

This main purpose of this class is tests, where it may be desirable to instantiate an IOAsioSocket object without involving system resource allocation such as real network sockets.

Parameters
CTemplate parameter identifying type of the callback object.

Definition at line 294 of file io_asio_socket.h.

Constructor & Destructor Documentation

◆ DummyAsioSocket()

template<typename C>
isc::asiolink::DummyAsioSocket< C >::DummyAsioSocket ( const int  protocol)
inline

Constructor from the protocol number.

The protocol must validly identify a standard network protocol. For example, to specify TCP protocol must be IPPROTO_TCP.

Parameters
protocolThe network protocol number for the socket.

Definition at line 305 of file io_asio_socket.h.

Member Function Documentation

◆ asyncReceive()

template<typename C>
virtual void isc::asiolink::DummyAsioSocket< C >::asyncReceive ( void *  ,
size_t  ,
size_t  ,
IOEndpoint ,
C &   
)
inlinevirtual

Receive Asynchronously.

Must be supplied as it is abstract in the base class. The parameters are unused.

Implements isc::asiolink::IOAsioSocket< C >.

Definition at line 348 of file io_asio_socket.h.

◆ asyncSend()

template<typename C>
virtual void isc::asiolink::DummyAsioSocket< C >::asyncSend ( const void *  ,
size_t  ,
const IOEndpoint ,
C &   
)
inlinevirtual

Send Asynchronously.

Must be supplied as it is abstract in the base class. This is unused.

Implements isc::asiolink::IOAsioSocket< C >.

Definition at line 341 of file io_asio_socket.h.

◆ cancel()

template<typename C>
virtual void isc::asiolink::DummyAsioSocket< C >::cancel ( )
inlinevirtual

Cancel I/O On AsioSocket.

Must be supplied as it is abstract in the base class.

Implements isc::asiolink::IOAsioSocket< C >.

Definition at line 365 of file io_asio_socket.h.

◆ close()

template<typename C>
virtual void isc::asiolink::DummyAsioSocket< C >::close ( )
inlinevirtual

Close socket.

Must be supplied as it is abstract in the base class.

Implements isc::asiolink::IOAsioSocket< C >.

Definition at line 371 of file io_asio_socket.h.

◆ getNative()

template<typename C>
virtual int isc::asiolink::DummyAsioSocket< C >::getNative ( ) const
inlinevirtual

A dummy derived method of IOAsioSocket::getNative().

Returns
Always returns -1 as the object is not associated with a real (native) socket.

Implements isc::asiolink::IOAsioSocket< C >.

Definition at line 311 of file io_asio_socket.h.

◆ getProtocol()

template<typename C>
virtual int isc::asiolink::DummyAsioSocket< C >::getProtocol ( ) const
inlinevirtual

A dummy derived method of IOAsioSocket::getProtocol().

Returns
Protocol socket was created with

Implements isc::asiolink::IOAsioSocket< C >.

Definition at line 316 of file io_asio_socket.h.

◆ isOpenSynchronous()

template<typename C>
bool isc::asiolink::DummyAsioSocket< C >::isOpenSynchronous ( ) const
inlinevirtual

Is socket opening synchronous?

Returns
true - it is for this class.

Implements isc::asiolink::IOAsioSocket< C >.

Definition at line 322 of file io_asio_socket.h.

◆ open()

template<typename C>
virtual bool isc::asiolink::DummyAsioSocket< C >::open ( const IOEndpoint ,
C &   
)
inlinevirtual

Open AsioSocket.

A call that is a no-op on UDP sockets, this opens a connection to the system identified by the given endpoint. The endpoint and callback are unused.

Returns
false indicating that the operation completed synchronously.

Implements isc::asiolink::IOAsioSocket< C >.

Definition at line 333 of file io_asio_socket.h.

◆ receiveComplete()

template<typename C>
virtual bool isc::asiolink::DummyAsioSocket< C >::receiveComplete ( const void *  ,
size_t  ,
size_t &  ,
size_t &  ,
size_t &  ,
isc::util::OutputBufferPtr  
)
inlinevirtual

Checks if the data received is complete.

The parameters are unused.

Returns
Always true

Definition at line 355 of file io_asio_socket.h.


The documentation for this class was generated from the following file: