YARP
Yet Another Robot Platform
UdpCarrier.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3  * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #ifndef YARP_OS_IMPL_UDPCARRIER_H
8 #define YARP_OS_IMPL_UDPCARRIER_H
9 
12 
13 namespace yarp {
14 namespace os {
15 namespace impl {
16 
20 class UdpCarrier :
21  public AbstractCarrier
22 {
23 public:
25 
26  Carrier* create() const override;
27 
28  std::string getName() const override;
29 
30  virtual int getSpecifierCode() const;
31 
32  bool checkHeader(const Bytes& header) override;
33  void getHeader(Bytes& header) const override;
34  void setParameters(const Bytes& header) override;
35  bool requireAck() const override;
36  bool isConnectionless() const override;
37  bool respondToHeader(ConnectionState& proto) override;
38  bool expectReplyToHeader(ConnectionState& proto) override;
39 };
40 
41 } // namespace impl
42 } // namespace os
43 } // namespace yarp
44 
45 #endif // YARP_OS_IMPL_UDPCARRIER_H
A starter class for implementing simple carriers.
A simple abstraction for a block of bytes.
Definition: Bytes.h:25
A base class for connection types (tcp, mcast, shmem, ...) which are called carriers in YARP.
Definition: Carrier.h:45
The basic state of a connection - route, streams in use, etc.
Communicating between two ports via UDP.
Definition: UdpCarrier.h:22
bool expectReplyToHeader(ConnectionState &proto) override
Process reply to header, if one is expected for this carrier.
Definition: UdpCarrier.cpp:82
void setParameters(const Bytes &header) override
Configure this carrier based on the first 8 bytes of the connection.
Definition: UdpCarrier.cpp:44
bool requireAck() const override
Check if carrier has flow control, requiring sent messages to be acknowledged by recipient.
Definition: UdpCarrier.cpp:49
Carrier * create() const override
Factory method.
Definition: UdpCarrier.cpp:19
virtual int getSpecifierCode() const
Definition: UdpCarrier.cpp:29
void getHeader(Bytes &header) const override
Provide 8 bytes describing this connection sufficiently to allow the other side of a connection to se...
Definition: UdpCarrier.cpp:39
bool checkHeader(const Bytes &header) override
Given the first 8 bytes received on a connection, decide if this is the right carrier type to use for...
Definition: UdpCarrier.cpp:34
bool respondToHeader(ConnectionState &proto) override
Respond to the header.
Definition: UdpCarrier.cpp:60
std::string getName() const override
Get the name of this connection type ("tcp", "mcast", "shmem", ...)
Definition: UdpCarrier.cpp:24
bool isConnectionless() const override
Check if this carrier is connectionless (like udp, mcast) or connection based (like tcp).
Definition: UdpCarrier.cpp:54
The main, catch-all namespace for YARP.
Definition: dirs.h:16