CatapultServer  v0.5.0.1 (Elephant)
ChainedSocketReader.h
Go to the documentation of this file.
1 
21 #pragma once
24 #include <functional>
25 #include <memory>
26 
27 namespace catapult {
28  namespace ionet {
29  class PacketSocket;
30  struct ReaderIdentity;
31  }
32 }
33 
34 namespace catapult { namespace net {
35 
39  public:
40  virtual ~ChainedSocketReader() = default;
41 
42  public:
45 
46  public:
48  virtual void start() = 0;
49 
51  virtual void stop() = 0;
52  };
53 
56  std::shared_ptr<ChainedSocketReader> CreateChainedSocketReader(
57  const std::shared_ptr<ionet::PacketSocket>& pPacketSocket,
58  const ionet::ServerPacketHandlers& serverHandlers,
59  const ionet::ReaderIdentity& identity);
60 
63  std::shared_ptr<ChainedSocketReader> CreateChainedSocketReader(
64  const std::shared_ptr<ionet::PacketSocket>& pPacketSocket,
65  const ionet::ServerPacketHandlers& serverHandlers,
66  const ionet::ReaderIdentity& identity,
67  const ChainedSocketReader::CompletionHandler& completionHandler);
68 }}
BufferedPacketIo.h
CATAPULT_LOG
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
m_completionHandler
ChainedSocketReader::CompletionHandler m_completionHandler
Definition: ChainedSocketReader.cpp:74
colorPrint.warning
def warning(*args)
Definition: colorPrint.py:10
catapult::net::ChainedSocketReader::~ChainedSocketReader
virtual ~ChainedSocketReader()=default
catapult::net::ChainedSocketReader::start
virtual void start()=0
Starts reading.
SocketReader.h
catapult::ionet::ReaderIdentity
Identifying information about a reader.
Definition: ReaderIdentity.h:28
ChainedSocketReader.h
catapult::ionet::SocketOperationCode
SocketOperationCode
Enumeration of socket operation results.
Definition: SocketOperationCode.h:50
PacketHandlers.h
catapult::net::ChainedSocketReader::CompletionHandler
consumer< ionet::SocketOperationCode > CompletionHandler
Callback that is called when the read chain is broken.
Definition: ChainedSocketReader.h:44
PacketSocket.h
m_pReader
std::unique_ptr< ionet::SocketReader > m_pReader
Definition: ChainedSocketReader.cpp:75
m_identity
ionet::ReaderIdentity m_identity
Definition: ChainedSocketReader.cpp:73
catapult::net::ChainedSocketReader::stop
virtual void stop()=0
Stops reading.
m_pPacketSocket
std::shared_ptr< ionet::PacketSocket > m_pPacketSocket
Definition: ChainedSocketReader.cpp:72
catapult::net::CreateChainedSocketReader
std::shared_ptr< ChainedSocketReader > CreateChainedSocketReader(const std::shared_ptr< ionet::PacketSocket > &pPacketSocket, const ionet::ServerPacketHandlers &serverHandlers, const ionet::ReaderIdentity &identity)
Definition: ChainedSocketReader.cpp:79
catapult::ionet::CreateSocketReader
std::unique_ptr< SocketReader > CreateSocketReader(const std::shared_ptr< BatchPacketReader > &pReader, const std::shared_ptr< PacketIo > &pWriter, const ServerPacketHandlers &handlers, const ReaderIdentity &identity)
Creates a socket packet reader around pReader, pWriter and handlers given a reader identity.
Definition: SocketReader.cpp:179
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::net::ChainedSocketReader
Definition: ChainedSocketReader.h:38
Logging.h
catapult::consumer
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
catapult::ionet::ServerPacketHandlers
A collection of packet handlers where there is at most one handler per packet type.
Definition: PacketHandlers.h:62
SocketOperationCode.h