Privacy
An open-source, flexible 3D physical simulation framework
mars::utils::TCPBaseSocket Class Reference

Public Member Functions

 TCPBaseSocket ()
 
 ~TCPBaseSocket ()
 
SocketError init ()
 
void close ()
 
SocketError bind (const std::string &addr, unsigned short port)
 
SocketError listen (int queueSize)
 
SocketError connect (const std::string &host, unsigned short port)
 
TCPBaseSocketaccept ()
 
TCPBaseSocketconnect ()
 
size_t send (const char *data, size_t len) const
 
size_t recv (char *data, size_t maxLen)
 
void setFlags (unsigned int flags)
 
int getSocketFamily () const
 
int getSocketType () const
 
int getSocketProtocol () const
 
bool isConnected () const
 
double getTimeout () const
 
void setTimeout (double timeout)
 

Private Member Functions

int internal_select (bool writing, double timeout)
 

Private Attributes

unsigned int flags
 
int sock_fd
 
double sock_timeout
 

Detailed Description

Definition at line 82 of file Socket.cpp.

Constructor & Destructor Documentation

◆ TCPBaseSocket()

mars::utils::TCPBaseSocket::TCPBaseSocket ( )

Definition at line 310 of file Socket.cpp.

◆ ~TCPBaseSocket()

mars::utils::TCPBaseSocket::~TCPBaseSocket ( )

Definition at line 326 of file Socket.cpp.

Member Function Documentation

◆ accept()

TCPBaseSocket * mars::utils::TCPBaseSocket::accept ( void  )

Definition at line 388 of file Socket.cpp.

◆ bind()

SocketError mars::utils::TCPBaseSocket::bind ( const std::string &  addr,
unsigned short  port 
)

Definition at line 355 of file Socket.cpp.

◆ close()

void mars::utils::TCPBaseSocket::close ( )

Definition at line 344 of file Socket.cpp.

◆ connect() [1/2]

SocketError mars::utils::TCPBaseSocket::connect ( const std::string &  host,
unsigned short  port 
)

Definition at line 419 of file Socket.cpp.

◆ connect() [2/2]

TCPBaseSocket* mars::utils::TCPBaseSocket::connect ( )

◆ getSocketFamily()

int mars::utils::TCPBaseSocket::getSocketFamily ( ) const

Definition at line 452 of file Socket.cpp.

◆ getSocketProtocol()

int mars::utils::TCPBaseSocket::getSocketProtocol ( ) const

Definition at line 458 of file Socket.cpp.

◆ getSocketType()

int mars::utils::TCPBaseSocket::getSocketType ( ) const

Definition at line 455 of file Socket.cpp.

◆ getTimeout()

double mars::utils::TCPBaseSocket::getTimeout ( ) const

Definition at line 491 of file Socket.cpp.

◆ init()

SocketError mars::utils::TCPBaseSocket::init ( void  )

Definition at line 333 of file Socket.cpp.

◆ internal_select()

int mars::utils::TCPBaseSocket::internal_select ( bool  writing,
double  timeout 
)
private

Definition at line 497 of file Socket.cpp.

◆ isConnected()

bool mars::utils::TCPBaseSocket::isConnected ( ) const

Definition at line 488 of file Socket.cpp.

◆ listen()

SocketError mars::utils::TCPBaseSocket::listen ( int  queueSize)

Definition at line 380 of file Socket.cpp.

◆ recv()

size_t mars::utils::TCPBaseSocket::recv ( char *  data,
size_t  maxLen 
)

Definition at line 448 of file Socket.cpp.

◆ send()

size_t mars::utils::TCPBaseSocket::send ( const char *  data,
size_t  len 
) const

Definition at line 443 of file Socket.cpp.

◆ setFlags()

void mars::utils::TCPBaseSocket::setFlags ( unsigned int  flags)

Definition at line 461 of file Socket.cpp.

◆ setTimeout()

void mars::utils::TCPBaseSocket::setTimeout ( double  timeout)

Definition at line 494 of file Socket.cpp.

Member Data Documentation

◆ flags

unsigned int mars::utils::TCPBaseSocket::flags
private

Definition at line 104 of file Socket.cpp.

◆ sock_fd

int mars::utils::TCPBaseSocket::sock_fd
private

Definition at line 105 of file Socket.cpp.

◆ sock_timeout

double mars::utils::TCPBaseSocket::sock_timeout
private

Definition at line 106 of file Socket.cpp.


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