summaryrefslogtreecommitdiff
path: root/i/simulotron/src/socket/socket_client.hh
diff options
context:
space:
mode:
authorhaller2005-12-03 17:21:26 +0000
committerhaller2005-12-03 17:21:26 +0000
commit6e48eaad66126f83480729a38dca1897f2066c11 (patch)
treef1b57ae0d85fc45a22b4fcf1aaad17a3f8eb5113 /i/simulotron/src/socket/socket_client.hh
parent8becc9cd13865719346d029a263e9ad4143915c6 (diff)
* Ajout de autoheader dans le autogen
* Splittage de Socket
Diffstat (limited to 'i/simulotron/src/socket/socket_client.hh')
-rw-r--r--i/simulotron/src/socket/socket_client.hh30
1 files changed, 30 insertions, 0 deletions
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 <string>
+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);
+};