Kea 2.7.5
|
The DummySocket
class is a concrete derived class of IOSocket
that is not associated with any real socket.
More...
Public Member Functions | |
DummySocket (const int protocol) | |
Constructor from the protocol number. | |
virtual int | getNative () const |
A dummy derived method of IOSocket::getNative() . | |
virtual int | getProtocol () const |
Return the transport protocol of the socket. | |
Public Member Functions inherited from isc::asiolink::IOSocket | |
virtual | ~IOSocket () |
The destructor. | |
Additional Inherited Members | |
Public Types inherited from isc::asiolink::IOSocket | |
typedef boost::asio::socket_base::reuse_address | ReuseAddress |
Represents SO_REUSEADDR socket option. | |
Static Public Member Functions inherited from isc::asiolink::IOSocket | |
static IOSocket & | getDummyUDPSocket () |
Return a non-usable "dummy" UDP socket for testing. | |
static IOSocket & | getDummyTCPSocket () |
Return a non-usable "dummy" TCP socket for testing. | |
Protected Member Functions inherited from isc::asiolink::IOSocket | |
IOSocket () | |
The default constructor. | |
The DummySocket
class is a concrete derived class of IOSocket
that is not associated with any real socket.
This main purpose of this class is tests, where it may be desirable to instantiate an IOSocket
object without involving system resource allocation such as real network sockets.
Definition at line 20 of file io_socket.cc.
|
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
.
protocol | The network protocol number for the socket. |
Definition at line 31 of file io_socket.cc.
|
inlinevirtual |
A dummy derived method of IOSocket::getNative()
.
This version of method always returns -1 as the object is not associated with a real (native) socket.
Implements isc::asiolink::IOSocket.
Definition at line 37 of file io_socket.cc.
|
inlinevirtual |
Return the transport protocol of the socket.
Currently, it returns IPPROTO_UDP
for UDP sockets, and IPPROTO_TCP
for TCP sockets.
This method never throws an exception.
Implements isc::asiolink::IOSocket.
Definition at line 39 of file io_socket.cc.