Reorganize socket classes
This commit is contained in:
23
src/server/socket/clientsocket.hpp
Normal file
23
src/server/socket/clientsocket.hpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
class ClientSocket
|
||||
{
|
||||
private:
|
||||
int fileDescriptor;
|
||||
|
||||
public:
|
||||
// Parameter limit is a multiple of 128
|
||||
std::vector<char> ReadBytes(size_t limit = 512) const;
|
||||
|
||||
size_t WriteBytes(std::vector<char> const & bytes) const;
|
||||
|
||||
ClientSocket(int _fileDescriptor);
|
||||
~ClientSocket();
|
||||
|
||||
ClientSocket(ClientSocket && other);
|
||||
|
||||
ClientSocket(ClientSocket & other) = delete;
|
||||
ClientSocket & operator=(ClientSocket & other) = delete;
|
||||
};
|
||||
Reference in New Issue
Block a user