httpsession.h
上传用户:zslianheng
上传日期:2013-04-03
资源大小:946k
文件大小:1k
源码类别:

Linux/Unix编程

开发平台:

Visual C++

  1. /***************************************************************************
  2.  *                                                                         *
  3.  *   This program is free software; you can redistribute it and/or modify  *
  4.  *   it under the terms of the GNU General Public License as published by  *
  5.  *   the Free Software Foundation; either version 2 of the License, or     *
  6.  *   (at your option) any later version.                                   *
  7.  *                                                                         *
  8.  *   copyright            : (C) 2002 by Zhang Yong                         *
  9.  *   email                : z-yong163@163.com                              *
  10.  ***************************************************************************/
  11. #ifndef _HTTP_SESSION_H
  12. #define _HTTP_SESSION_H
  13. #include "socketlistener.h"
  14. #include "icqtypes.h"
  15. class SessionListener;
  16. class ProxyInfo;
  17. class HttpSession : public SocketListener {
  18. public:
  19. HttpSession();
  20. ~HttpSession();
  21. void setListener(SessionListener *l) {
  22. listener = l;
  23. }
  24. bool start(const char *destHost, ProxyInfo &proxy);
  25. int sock;
  26. char buf[4096];
  27. private:
  28. virtual void onConnect(bool success);
  29. virtual bool onReceive();
  30. virtual void onClose();
  31. bool recvPacket();
  32. int status;
  33. int bufSize;
  34. string uname;
  35. string passwd;
  36. string destHost;
  37. SessionListener *listener;
  38. };
  39. #endif