Guest User

Untitled

a guest
Mar 13th, 2018
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. /***************************************************************************
  2. * Connection.h
  3. *
  4. * Fri Mar 7 15:39:15 2008
  5. * Copyright 2008 Cain
  6. * Email Darkdemun@gmail.com
  7. ****************************************************************************/
  8. #ifndef CONNECT
  9. #define CONNECT 1
  10. #include "Server.h"
  11. #include <iostream>
  12. #include <string>
  13. #include <sys/types.h>
  14. #include <sys/socket.h>
  15. #include <netinet/in.h>
  16. #include <arpa/inet.h>
  17. #include <netdb.h>
  18. using namespace std;
  19.  
  20. class Connection
  21. {
  22. public:
  23. Connection();
  24. Connection(Serv server);
  25. ~Connection();
  26. int SendStr(string str);
  27. int RecvStr(string * buffer);
  28. string GetTime() const;
  29. bool IsConnected() const;
  30. private:
  31. int Connect(Serv server);
  32.  
  33. bool connected;
  34. struct hostent *he;
  35. struct sockaddr_in dest_addr;
  36. int sockfd;
  37. };
  38. #endif
Add Comment
Please, Sign In to add comment