Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***************************************************************************
- * Connection.h
- *
- * Fri Mar 7 15:39:15 2008
- * Copyright 2008 Cain
- * Email Darkdemun@gmail.com
- ****************************************************************************/
- #ifndef CONNECT
- #define CONNECT 1
- #include "Server.h"
- #include <iostream>
- #include <string>
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <netdb.h>
- using namespace std;
- class Connection
- {
- public:
- Connection();
- Connection(Serv server);
- ~Connection();
- int SendStr(string str);
- int RecvStr(string * buffer);
- string GetTime() const;
- bool IsConnected() const;
- private:
- int Connect(Serv server);
- bool connected;
- struct hostent *he;
- struct sockaddr_in dest_addr;
- int sockfd;
- };
- #endif
Add Comment
Please, Sign In to add comment