summaryrefslogtreecommitdiff
path: root/i/simulotron/src/socket/socket.hh
diff options
context:
space:
mode:
authorhaller2005-11-29 01:58:16 +0000
committerhaller2005-11-29 01:58:16 +0000
commit8020ef753b8d434c026299650fe911d71d844e78 (patch)
treec8ba23fd3d95cbd12067d2437d678f50c196442b /i/simulotron/src/socket/socket.hh
parent1c63701ecc8a1cff6979bdb3688cf62f4cc267f5 (diff)
Modification dans l'A/A
Codage du test de socket(qui foire)
Diffstat (limited to 'i/simulotron/src/socket/socket.hh')
-rw-r--r--i/simulotron/src/socket/socket.hh18
1 files changed, 11 insertions, 7 deletions
diff --git a/i/simulotron/src/socket/socket.hh b/i/simulotron/src/socket/socket.hh
index 27f3f5d..a1d6d65 100644
--- a/i/simulotron/src/socket/socket.hh
+++ b/i/simulotron/src/socket/socket.hh
@@ -1,3 +1,4 @@
+#include <string>
class Address;
class Socket
@@ -5,27 +6,30 @@ class Socket
private:
/// Ze socket
int socket_;
+ /// constantes
+ /// Taille max du buffer de lecture/ecriture
+ static const int BUFFER_SIZE = 256;
public:
/// Constructeur
Socket(const Address & address);
/// Constructeur à partir d'un fd
Socket(int socket);
+ /// Destructeur
+ ~Socket(void);
/// Connect le client au serveur
void connect(const Address & address);
/// Ecoute le port
void listen(int maxQueue);
/// accepte une connection
- Socket accept(Address & adress);
+ Socket accept(Address & address);
/// lit du socket
- void read(void);
+ std::string read(void);
/// écrit dans le socket
- void write(void);
+ void write(const std::string & str);
/// lit un charactère du socket
- void getChar(void);
+ char getChar(void);
/// écrit un charactère dans le socket
- void putChar(void);
+ void putChar(char c);
/// Drapeau connecté
bool isConnected(void);
- private:
- void bind();
};