Kea 2.7.5
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.
 
virtual void asyncReceive (void *, size_t, size_t, IOEndpoint *, C &)
 Receive Asynchronously.
 
virtual void asyncSend (const void *, size_t, const IOEndpoint *, C &)
 Send Asynchronously.
 
virtual void cancel ()
 Cancel I/O On AsioSocket.
 
virtual void close ()
 Close socket.
 
virtual int getNative () const
 A dummy derived method of IOAsioSocket::getNative().
 
virtual int getProtocol () const
 A dummy derived method of IOAsioSocket::getProtocol().
 
bool isOpenSynchronous () const
 Is socket opening synchronous?
 
virtual bool open (const IOEndpoint *, C &)
 Open AsioSocket.
 
virtual bool receiveComplete (const void *, size_t, size_t &, size_t &, size_t &, isc::util::OutputBufferPtr &)
 Checks if the data received is complete.
 

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 293 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 304 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 347 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 340 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 364 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 370 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 310 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 315 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 321 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 332 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 354 of file io_asio_socket.h.


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