mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 15:00:02 +02:00
25 lines
537 B
C++
25 lines
537 B
C++
#pragma once
|
|
|
|
#include "DataSocket.h"
|
|
|
|
#include <cstdint>
|
|
#include <netdb.h>
|
|
#include <string>
|
|
#include <sys/socket.h>
|
|
#include <sys/types.h>
|
|
|
|
namespace sls {
|
|
|
|
class ServerSocket : public DataSocket {
|
|
public:
|
|
ServerSocket(int port);
|
|
DataSocket accept();
|
|
const std::string &getLastClient() { return lastClient_; }
|
|
|
|
private:
|
|
std::string lastClient_ = std::string(INET_ADDRSTRLEN, '\0');
|
|
std::string thisClient_ = std::string(INET_ADDRSTRLEN, '\0');
|
|
// char lastClient_[INET_ADDRSTRLEN]{};
|
|
};
|
|
|
|
}; //namespace sls
|