Jetpack documentation 1.0.0
Loading...
Searching...
No Matches
Socket.hpp
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2025
3** jetpack
4** File description:
5** The Socket.hpp
6*/
13#ifndef SOCKET_HPP_
14 #define SOCKET_HPP_
15
16 #include "utils/Exception.hpp"
17 #include "utils/Logs.hpp"
18
19namespace Jetpack {
24 class Socket
25 {
26 public:
34 Socket(int domain, int type, int protocol);
39 Socket(int sockfd = -1);
44 ~Socket();
45
46
47
52 int getSocket() const;
57 void operator()(int sockfd);
62 void operator=(int sockfd);
69 bool operator==(int sockfd) const;
70
71
72
73 private:
74 int _sockfd; /* The socket file descriptor */
75 };
76}
77
78#endif /* SOCKET_HPP_ */
The Exception.hpp.
The Logs.hpp.
An encapsulation of the socket file descriptor.
Definition Socket.hpp:25
void operator=(int sockfd)
Sets the socket file descriptor.
Definition Socket.cpp:73
Socket(int domain, int type, int protocol)
Constructor for Socket class.
Definition Socket.cpp:23
void operator()(int sockfd)
Sets the socket file descriptor.
Definition Socket.cpp:64
int getSocket() const
Gets the socket file descriptor.
Definition Socket.cpp:55
~Socket()
Deleted copy constructor.
Definition Socket.cpp:45
bool operator==(int sockfd) const
Compares the socket file descriptor.
Definition Socket.cpp:84