CatapultServer  v0.5.0.1 (Elephant)
catapult::ionet::PacketSocket Class Referenceabstract
Inheritance diagram for catapult::ionet::PacketSocket:
Collaboration diagram for catapult::ionet::PacketSocket:

Classes

struct  Stats
 Statistics about a socket. More...
 

Public Types

using StatsCallback = consumer< const Stats & >
 
- Public Types inherited from catapult::ionet::PacketIo
using ReadCallback = consumer< SocketOperationCode, const Packet * >
 
using WriteCallback = consumer< SocketOperationCode >
 

Public Member Functions

virtual ~PacketSocket ()=default
 
virtual void stats (const StatsCallback &callback)=0
 Retrieves statistics about this socket and passes them to callback. More...
 
virtual void close ()=0
 Closes the socket. More...
 
virtual std::shared_ptr< PacketIobuffered ()=0
 Gets a buffered interface to the packet socket. More...
 
- Public Member Functions inherited from catapult::ionet::PacketIo
virtual ~PacketIo ()=default
 
virtual void read (const ReadCallback &callback)=0
 
virtual void write (const PacketPayload &payload, const WriteCallback &callback)=0
 Writes payload and calls callback on completion. More...
 
- Public Member Functions inherited from catapult::ionet::BatchPacketReader
virtual ~BatchPacketReader ()=default
 
virtual void readMultiple (const PacketIo::ReadCallback &callback)=0
 

Detailed Description

An asio socket wrapper that natively supports packets. This wrapper is threadsafe but does not prevent interleaving reads or writes.

Member Typedef Documentation

◆ StatsCallback

Constructor & Destructor Documentation

◆ ~PacketSocket()

virtual catapult::ionet::PacketSocket::~PacketSocket ( )
virtualdefault

Member Function Documentation

◆ buffered()

virtual std::shared_ptr<PacketIo> catapult::ionet::PacketSocket::buffered ( )
pure virtual

Gets a buffered interface to the packet socket.

◆ close()

virtual void catapult::ionet::PacketSocket::close ( )
pure virtual

Closes the socket.

◆ stats()

virtual void catapult::ionet::PacketSocket::stats ( const StatsCallback callback)
pure virtual

Retrieves statistics about this socket and passes them to callback.


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