33 lines
484 B
C++
33 lines
484 B
C++
#include <sys/types.h>
|
|
#include <sys/socket.h>
|
|
#include <netinet/in.h>
|
|
|
|
class client_tcp
|
|
{
|
|
public:
|
|
|
|
struct sockaddr_in serv_addr;
|
|
struct hostent* server;
|
|
int status;
|
|
int sock;
|
|
|
|
~client_tcp();
|
|
client_tcp(int client);
|
|
client_tcp(char *name, int port);
|
|
bool send(char* data, int size);
|
|
char* recv(int size);
|
|
};
|
|
|
|
class server_tcp
|
|
{
|
|
public:
|
|
|
|
struct sockaddr_in serv_addr;
|
|
int status;
|
|
int sock;
|
|
|
|
server_tcp(int port);
|
|
~server_tcp();
|
|
client_tcp cliaccept();
|
|
};
|