sockssession.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 _SOCKS_SESSION_H
  12. #define _SOCKS_SESSION_H
  13. #include "socketlistener.h"
  14. #include "icqtypes.h"
  15. class SessionListener;
  16. class ProxyInfo;
  17. class SocksSession : public SocketListener {
  18. public:
  19. SocksSession();
  20. ~SocksSession();
  21. void setListener(SessionListener *l) {
  22. listener = l;
  23. }
  24. bool start(ProxyInfo &socks, uint16 port = 0);
  25. int sock;
  26. uint32 socksIP; // network order
  27. uint16 socksPort;
  28. private:
  29. virtual void onConnect(bool success);
  30. virtual bool onReceive();
  31. virtual void onClose();
  32. uint16 localPort; // network order
  33. int status;
  34. string uname;
  35. string passwd;
  36. int udpSock;
  37. SessionListener *listener;
  38. };
  39. #endif