Class ITransport
Defined in File ITransport.h
Inheritance Relationships
Derived Types
public visionary::TcpSocket
(Class TcpSocket)public visionary::UdpSocket
(Class UdpSocket)
Class Documentation
-
class ITransport
Subclassed by visionary::TcpSocket, visionary::UdpSocket
Public Functions
-
inline virtual ~ITransport()
-
virtual int send(const std::vector<std::uint8_t> &buffer) = 0
Send data on socket to device
All bytes are sent on the socket. It is regarded as error if this is not possible.
- Parameters:
buffer – [in] buffer containing the bytes that shall be sent.
- Returns:
OS error code.
-
virtual int recv(std::vector<std::uint8_t> &buffer, std::size_t maxBytesToReceive) = 0
Receive data on socket to device
Receive at most maxBytesToReceive bytes.
- Parameters:
buffer – [in] buffer containing the bytes that shall be sent.
maxBytesToReceive – [in] maximum number of bytes to receive.
- Returns:
number of received bytes, negative values are OS error codes.
-
virtual int read(std::vector<std::uint8_t> &buffer, std::size_t nBytesToReceive) = 0
Read a number of bytes
Contrary to recv this method reads precisely nBytesToReceive bytes.
- Parameters:
buffer – [in] buffer containing the bytes that shall be sent.
maxBytesToReceive – [in] maximum number of bytes to receive.
- Returns:
number of received bytes, negative values are OS error codes.
-
inline virtual ~ITransport()