ImFusion SDK 4.3
GenericSocketInterface Class Reference

#include <RoboticsPlugin/Include/ImFusion/Robotics/IO/GenericSocketInterface.h>

Generic class to connect to a raw socket and send/receive text data. More...

Detailed Description

Generic class to connect to a raw socket and send/receive text data.

Public Member Functions

 GenericSocketInterface (std::string host, uint16_t port)
 
virtual bool connect ()
 
virtual bool closeConnection ()
 
void connectImpl ()
 
bool sendSomething (const std::string &message)
 Send up to 128 bytes of data through the socket interface, terminated by the m_sendSeparator character.
 
std::vector< std::stringreceiveSomething ()
 Receive from the socket and split at the m_receiveSeparator character.
 

Public Attributes

std::future< bool > m_connectionFuture
 
std::atomic< bool > m_connected = false
 
std::string m_host
 
uint16_t m_port
 
std::string m_sendSeparator
 Will be appended to every command sent.
 
std::string m_receiveSeparator
 Will be used to split the received responses.
 

Protected Attributes

std::unique_ptr< Impl > m_impl
 

The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close