Public Member Functions | Protected Attributes | List of all members
sick_scan_xd::ClientSocket Class Reference

#include <client_socket.h>

Public Member Functions

 ClientSocket ()
 
virtual bool close (bool force_shutdown=false)
 
virtual bool connect (const std::string &server_address, int tcp_port)
 
virtual socket_tsocket (void)
 
virtual ~ClientSocket ()
 

Protected Attributes

socket_t m_tcp_socket
 tcp client socket (int32 or SOCKET) More...
 

Detailed Description

Class sick_scan_xd::ClientSocket encapsulates connecting, closing and setting socket options for tcp client sockets implemented by boost::asio::ip::tcp::socket.

Definition at line 68 of file client_socket.h.

Constructor & Destructor Documentation

◆ ClientSocket()

sick_scan_xd::ClientSocket::ClientSocket ( )

Constructor.

Definition at line 66 of file client_socket.cpp.

◆ ~ClientSocket()

sick_scan_xd::ClientSocket::~ClientSocket ( )
virtual

Destructor, closes all tcp connections.

Definition at line 73 of file client_socket.cpp.

Member Function Documentation

◆ close()

bool sick_scan_xd::ClientSocket::close ( bool  force_shutdown = false)
virtual

Closes the tcp connection to the server.

Parameters
[in]force_shutdownif true, the socket is shutdown even if it's state is not opened or connected (otherwise the socket is closed, if its state is currently opened)
Returns
true on success (socket closed), false on failure

Definition at line 158 of file client_socket.cpp.

◆ connect()

bool sick_scan_xd::ClientSocket::connect ( const std::string &  server_address,
int  tcp_port 
)
virtual

Connects to a server.

Parameters
[in]server_addressip address of the localization controller, default: 192.168.0.1
[in]tcp_porttcp port for command requests, default: 2111 for command requests and 2112 for command responses
Returns
true on success, false on failure (server unknown or unreachable)

Definition at line 84 of file client_socket.cpp.

◆ socket()

virtual socket_t& sick_scan_xd::ClientSocket::socket ( void  )
inlinevirtual

Returns the tcp client socket implementation

Returns
tcp client socket implementation

Definition at line 102 of file client_socket.h.

Member Data Documentation

◆ m_tcp_socket

socket_t sick_scan_xd::ClientSocket::m_tcp_socket
protected

tcp client socket (int32 or SOCKET)

Definition at line 106 of file client_socket.h.


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


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:21