summaryrefslogtreecommitdiff
path: root/i/simulotron/src/socket/socket_client.hh
blob: 112a4dd56c7af734741a62be1678f99ef403b708 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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);
};