1
0
mirror of https://gitlab.com/obbart/universal_robots_ros_driver.git synced 2026-04-10 18:10:47 +02:00
Files
universal_robots_ros_driver/include/ur_modern_driver/ur/server.h
2017-07-21 19:02:19 +02:00

28 lines
564 B
C++

#pragma once
#include <netdb.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <atomic>
#include <cstdlib>
#include <mutex>
#include <string>
#include "ur_modern_driver/tcp_socket.h"
class URServer : private TCPSocket
{
private:
int port_;
TCPSocket client_;
protected:
virtual bool open(int socket_fd, struct sockaddr *address, size_t address_len);
public:
URServer(int port);
~URServer();
std::string getIP();
bool bind();
bool accept();
void disconnectClient();
bool write(const uint8_t *buf, size_t buf_len, size_t &written);
};