Logo
~Sockets~
~Examples~
~Contact~


MinderSocket.h

Go to the documentation of this file.
00001 /*
00002  **     File ......... MinderSocket.h
00003  **     Published ....  2004-04-17
00004  **     Author ....... grymse@alhem.net
00005 **/
00006 /*
00007 Copyright (C) 2004  Anders Hedstrom
00008 
00009 This program is free software; you can redistribute it and/or
00010 modify it under the terms of the GNU General Public License
00011 as published by the Free Software Foundation; either version 2
00012 of the License, or (at your option) any later version.
00013 
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 */
00023 #ifndef _SOCKETS_MinderSocket_H
00024 #define _SOCKETS_MinderSocket_H
00025 #include "sockets-config.h"
00026 #ifdef HAVE_OPENSSL
00027 
00028 #include "TcpSocket.h"
00029 #include "MinionSocket.h"
00030 //#include "Utility.h"
00031 
00032 #ifdef SOCKETS_NAMESPACE
00033 namespace SOCKETS_NAMESPACE {
00034 #endif
00035 
00036 
00039 class MinderSocket : public TcpSocket
00040 {
00041 public:
00042         MinderSocket(ISocketHandler& ,const std::string& );
00043         ~MinderSocket();
00044 
00045         void SetLocalIpPort(const std::string& x,port_t p) { local_ip = x; local_port = p; }
00046 
00047         void Function(const std::string& str) { m_function = str; }
00048         void SendHello();
00049         void SetExtraInfo(long x) { m_extra_info = x; }
00050 
00051         virtual MinionSocket *CreateMinionSocket(const std::string& ,ipaddr_t,port_t) = 0;
00052 
00053         virtual int GetMaxConnections() = 0;
00054         virtual void OnSwitchDatabase(const std::string& ) = 0;
00055 
00056 static  char g_UpdateHost[256];
00057 static  port_t g_UpdatePort;
00058 static  char g_UpdateUrl[256];
00059 
00060 protected:
00061         void OnLine(const std::string& line);
00062         void OnConnect();
00063 
00064 private:
00065         MinderSocket& operator=(const MinderSocket& ) { return *this; }
00066         std::string m_app;
00067         std::string local_ip;
00068         port_t local_port;
00069         ipaddr_t my_ip;
00070         port_t my_port;
00071         std::string m_function;
00072         long m_extra_info;
00073 };
00074 
00075 
00076 #ifdef SOCKETS_NAMESPACE
00077 }
00078 #endif
00079 
00080 #endif // HAVE_OPENSSL
00081 #endif // _SOCKETS_MinderSocket_H
Page, code, and content Copyright (C) 2007 by Anders Hedström
Generated for C++ Sockets by  doxygen 1.4.4