summaryrefslogtreecommitdiff
path: root/i/simulotron/src/socket/socket.hh
diff options
context:
space:
mode:
Diffstat (limited to 'i/simulotron/src/socket/socket.hh')
-rw-r--r--i/simulotron/src/socket/socket.hh29
1 files changed, 29 insertions, 0 deletions
diff --git a/i/simulotron/src/socket/socket.hh b/i/simulotron/src/socket/socket.hh
new file mode 100644
index 0000000..c1b47df
--- /dev/null
+++ b/i/simulotron/src/socket/socket.hh
@@ -0,0 +1,29 @@
+class Socket
+{
+ private:
+ /// Ze socket
+ int socket_;
+ public:
+ /// Constructeur
+ Socket(const Address & adress, bool block = false);
+ /// Constructeur à partir d'un fd
+ Socket(int socket);
+ /// Connect le client au serveur
+ void connect(void);
+ /// Ecoute le port
+ void listen(void);
+ /// accepte une connection
+ void accept(void);
+ /// lit du socket
+ void read(void);
+ /// écrit dans le socket
+ void write(void);
+ /// lit un charactère du socket
+ void getChar(void);
+ /// écrit un charactère dans le socket
+ void putChar(void);
+ /// Drapeau connecté
+ bool isConnected(void);
+ private:
+ void bind();
+};