mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 10:00:48 +02:00
minor improvements
This commit is contained in:
@@ -24,6 +24,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
URServer(int port);
|
URServer(int port);
|
||||||
|
~URServer();
|
||||||
std::string getIP();
|
std::string getIP();
|
||||||
bool bind();
|
bool bind();
|
||||||
bool accept();
|
bool accept();
|
||||||
|
|||||||
@@ -10,6 +10,11 @@ URServer::URServer(int port)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
URServer::~URServer()
|
||||||
|
{
|
||||||
|
TCPSocket::close();
|
||||||
|
}
|
||||||
|
|
||||||
void URServer::setOptions(int socket_fd)
|
void URServer::setOptions(int socket_fd)
|
||||||
{
|
{
|
||||||
TCPSocket::setOptions(socket_fd);
|
TCPSocket::setOptions(socket_fd);
|
||||||
@@ -61,6 +66,8 @@ bool URServer::accept()
|
|||||||
if(client_fd <= 0)
|
if(client_fd <= 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
setOptions(client_fd);
|
||||||
|
|
||||||
return client_.setSocketFD(client_fd);
|
return client_.setSocketFD(client_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user