00001 /*************************************************************************** 00002 socketmanager.h - description 00003 ------------------- 00004 begin : ven avr 21 2006 00005 copyright : (C) 2006 by Sylvain Archenault <sylvain.archenault@laposte.net> Yves Houpert <yves.houpert@insa-rouen.fr> 00006 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 #ifndef SOCKETMANAGER_H 00018 #define SOCKETMANAGER_H 00019 00020 #include <basemanager.h> 00021 #include <Kernel/socket.h> 00022 #include <Kernel/ecoute.h> 00023 #include <Kernel/ecriture.h> 00024 00025 class BaseMessage; 00026 class ConnectionManager; 00027 00033 class SocketManager : public BaseManager 00034 { 00035 public: //public methods 00040 SocketManager(ConnectionManager& rConnectionManager, KernelMessenger& rKernel, ListeWidget& rWidget); 00041 00043 ~SocketManager(); 00044 00047 void writeMessage(const BaseMessage& message); 00048 00050 void close(); 00051 00055 void connectToHost(const std::string& hostname, const int port); 00056 00059 void messageRead(const std::string& xmlMessage); 00060 00063 void setSocketStatus(const bool bStatus); 00064 00065 private: //private method. 00067 ConnectionManager& m_rConnectionManager; 00068 00070 Socket m_Socket; 00071 00073 Ecriture m_Ecriture; 00074 00076 Ecoute m_Lecture; 00077 }; 00078 00079 #endif
1.4.6