join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
TcpSocket Class Reference

Class used to test the TCP socket API. More...

Inheritance diagram for TcpSocket:
Collaboration diagram for TcpSocket:

Protected Member Functions

void SetUp () override
 Sets up the test fixture.
 
void TearDown () override
 Tears down the test fixture.
 
virtual void onReadable (int fd) override
 method called when data are ready to be read on handle.
 
- Protected Member Functions inherited from join::EventHandler
virtual void onEvent (int fd, uint32_t revents)
 method called when events are reported on handle.
 
virtual void onWriteable (int fd)
 method called when data are ready to be written on handle.
 
virtual void onClose (int fd)
 method called when handle was closed by the peer.
 
virtual void onError (int fd)
 method called when an error occurred on handle.
 

Protected Attributes

Tcp::Acceptor _server
 server.
 

Static Protected Attributes

static const std::string _hostv4 = "127.0.0.1"
 host.
 
static const std::string _hostv6 = "::1"
 
static const uint16_t _port = 5000
 port.
 
static const uint16_t _stallport = 5002
 ports of the acceptors used to test the operation deadlines.
 
static const uint16_t _stallport2 = 5003
 
static const std::chrono::milliseconds _timeout {1000}
 timeout.
 

Additional Inherited Members

- Public Member Functions inherited from join::EventHandler
 EventHandler ()=default
 create instance.
 
 EventHandler (const EventHandler &other)=default
 copy constructor.
 
EventHandleroperator= (const EventHandler &other)=default
 copy assignment operator.
 
 EventHandler (EventHandler &&other)=default
 move constructor.
 
EventHandleroperator= (EventHandler &&other)=default
 move assignment operator.
 
virtual ~EventHandler ()=default
 destroy instance.
 

Detailed Description

Class used to test the TCP socket API.

Member Function Documentation

◆ onReadable()

virtual void TcpSocket::onReadable ( int fd)
inlineoverrideprotectedvirtual

method called when data are ready to be read on handle.

Parameters
fdfile descriptor.

Reimplemented from join::EventHandler.

◆ SetUp()

void TcpSocket::SetUp ( )
inlineoverrideprotected

Sets up the test fixture.

◆ TearDown()

void TcpSocket::TearDown ( )
inlineoverrideprotected

Tears down the test fixture.

Member Data Documentation

◆ _hostv4

const std::string TcpSocket::_hostv4 = "127.0.0.1"
staticprotected

host.

◆ _hostv6

const std::string TcpSocket::_hostv6 = "::1"
staticprotected

◆ _port

const uint16_t TcpSocket::_port = 5000
staticprotected

port.

◆ _server

Tcp::Acceptor TcpSocket::_server
protected

server.

◆ _stallport

const uint16_t TcpSocket::_stallport = 5002
staticprotected

ports of the acceptors used to test the operation deadlines.

◆ _stallport2

const uint16_t TcpSocket::_stallport2 = 5003
staticprotected

◆ _timeout

const std::chrono::milliseconds TcpSocket::_timeout {1000}
staticprotected

timeout.


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