Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Socket Class Reference

#include <socket.hpp>

Public Member Functions

int clientOpen (std::string addr, std::string port)
 
int clientOpen (void)
 
int32_t clientRead (unsigned char *buffer, uint16_t buf_size)
 
int32_t clientWrite (unsigned char *buffer, uint16_t buf_size)
 
bool getConnected (void)
 
bool getPthreadRunning (void)
 
bool getRcvError (void)
 
bool getRcvTimeout (void)
 
int getServerSocket (void)
 
void setRcvError (bool flag)
 
void setRcvTimeout (bool flag)
 
 Socket ()
 
int tryReconnection (void)
 
 ~Socket ()
 

Public Attributes

std::queue< std::vector< unsigned char > > recvQueue
 

Private Member Functions

void putBufToMsg (unsigned char *buf, uint16_t size)
 

Private Attributes

std::string addr_st_
 
bool m_connected_
 
sockaddr_in m_server_addr_
 
int m_server_sock_
 
std::string port_num_st_
 
pthread_t pthrd_id_
 
bool pthread_running_
 
bool rcv_error_
 
bool rcv_timeout_
 

Friends

void * readCallback (void *arg)
 

Detailed Description

Definition at line 53 of file socket.hpp.

Constructor & Destructor Documentation

◆ Socket()

Socket::Socket ( )

Definition at line 41 of file socket.cpp.

◆ ~Socket()

Socket::~Socket ( )

Definition at line 53 of file socket.cpp.

Member Function Documentation

◆ clientOpen() [1/2]

int Socket::clientOpen ( std::string  addr,
std::string  port 
)

Definition at line 282 of file socket.cpp.

◆ clientOpen() [2/2]

int Socket::clientOpen ( void  )

◆ clientRead()

int32_t Socket::clientRead ( unsigned char *  buffer,
uint16_t  buf_size 
)

Definition at line 346 of file socket.cpp.

◆ clientWrite()

int32_t Socket::clientWrite ( unsigned char *  buffer,
uint16_t  buf_size 
)

Definition at line 368 of file socket.cpp.

◆ getConnected()

bool Socket::getConnected ( void  )

Definition at line 77 of file socket.cpp.

◆ getPthreadRunning()

bool Socket::getPthreadRunning ( void  )

Definition at line 82 of file socket.cpp.

◆ getRcvError()

bool Socket::getRcvError ( void  )

Definition at line 93 of file socket.cpp.

◆ getRcvTimeout()

bool Socket::getRcvTimeout ( void  )

Definition at line 88 of file socket.cpp.

◆ getServerSocket()

int Socket::getServerSocket ( void  )

Definition at line 72 of file socket.cpp.

◆ putBufToMsg()

void Socket::putBufToMsg ( unsigned char *  buf,
uint16_t  size 
)
private

Definition at line 137 of file socket.cpp.

◆ setRcvError()

void Socket::setRcvError ( bool  flag)

Definition at line 103 of file socket.cpp.

◆ setRcvTimeout()

void Socket::setRcvTimeout ( bool  flag)

Definition at line 98 of file socket.cpp.

◆ tryReconnection()

int Socket::tryReconnection ( void  )

Definition at line 110 of file socket.cpp.

Friends And Related Function Documentation

◆ readCallback

void* readCallback ( void *  arg)
friend

Definition at line 150 of file socket.cpp.

Member Data Documentation

◆ addr_st_

std::string Socket::addr_st_
private

Definition at line 86 of file socket.hpp.

◆ m_connected_

bool Socket::m_connected_
private

Definition at line 91 of file socket.hpp.

◆ m_server_addr_

sockaddr_in Socket::m_server_addr_
private

Definition at line 84 of file socket.hpp.

◆ m_server_sock_

int Socket::m_server_sock_
private

Definition at line 89 of file socket.hpp.

◆ port_num_st_

std::string Socket::port_num_st_
private

Definition at line 87 of file socket.hpp.

◆ pthrd_id_

pthread_t Socket::pthrd_id_
private

Definition at line 85 of file socket.hpp.

◆ pthread_running_

bool Socket::pthread_running_
private

Definition at line 90 of file socket.hpp.

◆ rcv_error_

bool Socket::rcv_error_
private

Definition at line 93 of file socket.hpp.

◆ rcv_timeout_

bool Socket::rcv_timeout_
private

Definition at line 92 of file socket.hpp.

◆ recvQueue

std::queue<std::vector<unsigned char> > Socket::recvQueue

Definition at line 79 of file socket.hpp.


The documentation for this class was generated from the following files:


lsc_ros_driver
Author(s): Autonics-lidar
autogenerated on Sat Jan 14 2023 03:18:24