VOX
A little voxel engine
Loading...
Searching...
No Matches
ServerSocket.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "Socket.hpp"
4#include <cstring>
5#include <memory>
6#include <netdb.h>
7#include <netinet/tcp.h>
8
10
15class ServerSocket : public Socket
16{
17public:
18 static constexpr int MAX_BACKLOG = 10;
19 ServerSocket(int port);
20 virtual ~ServerSocket();
21
22 ServerSocket(const ServerSocket& other) = delete;
23 ServerSocket& operator=(const ServerSocket& other) = delete;
24
27
28 std::shared_ptr<ConnectionSocket> accept();
29private:
30
31};
a class that represents a server socket. you can accept connections from clients.
Definition: ServerSocket.hpp:16
virtual ~ServerSocket()
Definition: ServerSocket.cpp:48
static constexpr int MAX_BACKLOG
Definition: ServerSocket.hpp:18
ServerSocket(const ServerSocket &other)=delete
ServerSocket & operator=(const ServerSocket &other)=delete
std::shared_ptr< ConnectionSocket > accept()
Definition: ServerSocket.cpp:63
a RAII wrapper for a socket.
Definition: Socket.hpp:17