#include <client_socket.h>
|
| ClientSocket (boost::asio::io_service &io_service) |
|
virtual bool | close (bool force_shutdown=false) |
|
virtual bool | connect (boost::asio::io_service &io_service, const std::string &server_adress, int tcp_port) |
|
virtual boost::asio::ip::tcp::socket & | socket (void) |
|
virtual | ~ClientSocket () |
|
Class sick_scan::ClientSocket encapsulates connecting, closing and setting socket options for tcp client sockets implemented by boost::asio::ip::tcp::socket.
Definition at line 71 of file client_socket.h.
◆ ClientSocket()
sick_scan::ClientSocket::ClientSocket |
( |
boost::asio::io_service & |
io_service | ) |
|
Constructor.
- Parameters
-
[in] | io_service | boost io service for tcp connections (several sockets may share one io_service) |
Definition at line 64 of file client_socket.cpp.
◆ ~ClientSocket()
sick_scan::ClientSocket::~ClientSocket |
( |
| ) |
|
|
virtual |
◆ close()
bool sick_scan::ClientSocket::close |
( |
bool |
force_shutdown = false | ) |
|
|
virtual |
Closes the tcp connection to the server.
- Parameters
-
[in] | force_shutdown | if 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 146 of file client_socket.cpp.
◆ connect()
bool sick_scan::ClientSocket::connect |
( |
boost::asio::io_service & |
io_service, |
|
|
const std::string & |
server_adress, |
|
|
int |
tcp_port |
|
) |
| |
|
virtual |
Connects to a server.
- Parameters
-
[in] | io_service | boost io service for tcp connections (several sockets may share one io_service) |
[in] | server_adress | ip adress of the localization controller, default: 192.168.0.1 |
[in] | tcp_port | tcp 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 83 of file client_socket.cpp.
◆ socket()
virtual boost::asio::ip::tcp::socket& sick_scan::ClientSocket::socket |
( |
void |
| ) |
|
|
inlinevirtual |
Returns the tcp client socket implementation
- Returns
- tcp client socket implementation
Definition at line 107 of file client_socket.h.
◆ m_tcp_socket
boost::asio::ip::tcp::socket sick_scan::ClientSocket::m_tcp_socket |
|
protected |
The documentation for this class was generated from the following files: