34 lines
514 B
C
34 lines
514 B
C
|
/*
|
||
|
* Client.h
|
||
|
*
|
||
|
* Created on: 2014-10-18
|
||
|
* Author: hanshuo
|
||
|
*/
|
||
|
|
||
|
#ifndef CLIENT_H_
|
||
|
#define CLIENT_H_
|
||
|
|
||
|
#include"Socket.h"
|
||
|
#include<string>
|
||
|
|
||
|
class Client
|
||
|
{
|
||
|
public:
|
||
|
bool connectServer();
|
||
|
bool disconnectServer();
|
||
|
bool send(const std::string& _msg);
|
||
|
bool receiveResponse(std::string& _recv_msg);
|
||
|
|
||
|
void run();
|
||
|
private:
|
||
|
std::string ip;
|
||
|
unsigned short port;
|
||
|
std::string password;
|
||
|
Socket socket;
|
||
|
int random_key;
|
||
|
};
|
||
|
|
||
|
|
||
|
|
||
|
#endif /* CLIENT_H_ */
|