From 6e48eaad66126f83480729a38dca1897f2066c11 Mon Sep 17 00:00:00 2001 From: haller Date: Sat, 3 Dec 2005 17:21:26 +0000 Subject: * Ajout de autoheader dans le autogen * Splittage de Socket --- i/simulotron/src/socket/socket_client.hh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 i/simulotron/src/socket/socket_client.hh (limited to 'i/simulotron/src/socket/socket_client.hh') diff --git a/i/simulotron/src/socket/socket_client.hh b/i/simulotron/src/socket/socket_client.hh new file mode 100644 index 0000000..112a4dd --- /dev/null +++ b/i/simulotron/src/socket/socket_client.hh @@ -0,0 +1,30 @@ +#include +class Address; +class SocketServer; + +class SocketClient +{ + private: + /// Ze socket + int socket_; + /// constantes + /// Taille max du buffer de lecture/ecriture + static const int BUFFER_SIZE = 256; + public: + /// Constructeur + SocketClient(const Address & address); + /// Constructeur accept + SocketClient(SocketServer & socketServer); + /// Destructeur + ~SocketClient(void); + /// Connect le client au serveur + void connect(const Address & address); + /// lit du socket + std::string read(void); + /// écrit dans le socket + void write(const std::string & str); + /// lit un charactère du socket + char getChar(void); + /// écrit un charactère dans le socket + void putChar(char c); +}; -- cgit v1.2.3