Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
DatagramTcp.cxx
Go to the documentation of this file.
1
36
37#include "openlcb/DatagramImpl.hxx"
38
39namespace openlcb
40{
41
43 IfTcp *iface, int num_registry_entries, int num_clients)
44 : DatagramService(iface, num_registry_entries)
45{
46 auto *dg_send = if_tcp()->addressed_message_write_flow();
47 for (int i = 0; i < num_clients; ++i)
48 {
49 auto *client_flow = new DatagramClientImpl(if_tcp(), dg_send);
50 if_tcp()->add_owned_flow(client_flow);
51 client_allocator()->insert(static_cast<DatagramClient *>(client_flow));
52 }
53}
54
55TcpDatagramService::~TcpDatagramService()
56{
57}
58
59} // namespace openlcb
Datagram client implementation for CANbus-based datagram protocol.
Use this class to send datagrams.
Definition Datagram.hxx:79
Transport-agnostic dispatcher of datagrams.
Definition Datagram.hxx:161
TypedQAsync< DatagramClient > * client_allocator()
Datagram clients.
Definition Datagram.hxx:186
Network interface class for a character stream link that speaks the (point-to-point) TcpTransfer prot...
Definition IfTcp.hxx:67
void add_owned_flow(Executable *e) override
Transfers ownership of a module to the interface.
Definition IfTcp.cxx:53
MessageHandler * addressed_message_write_flow()
Definition If.hxx:210
TcpDatagramService(IfTcp *iface, int num_registry_entries, int num_clients)