SocketException.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2007 by Pierre Schmitt, Ludovic Giacomello, Nhi Ly      *
00003  *                                                                         *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #ifndef SOCKETEXCEPTION_H
00022 #define SOCKETEXCEPTION_H
00023 
00027 class SocketException{
00028 public:
00029         SocketException(){ mCause=-1; }
00035         SocketException(unsigned int cause){ mCause=cause; }
00036 
00037         SocketException(const SocketException &s){ mCause=s.mCause; }
00038         void operator=(const SocketException &s){ mCause=s.mCause;}
00039 
00043         void Afficher() const{
00044                 switch(mCause){
00045                         case 1:{
00046                                 cerr<<"ERREUR: Impossible d'ouvrir la socket"<<endl;
00047                                 break;
00048                         }
00049                         case 2:{
00050                                 cerr<<"ERREUR: Impossible de nommer la socket"<<endl;
00051                                 break;
00052                         }
00053                         case 3:{
00054                                 cerr<<"ERREUR: Impossible d'obtenir l'adresse distante"<<endl;
00055                                 break;
00056                         }
00057                         case 4:{
00058                                 cerr<<"ERREUR: Impossible d'établir une connexion avec l'hote distant"<<endl;
00059                                 break;
00060                         }
00061                         case 5:{
00062                                 cerr<<"ERREUR: Impossible d'accepter la connexion entrante"<<endl;
00063                                 break;
00064                         }
00065                         case 6:{
00066                                 cerr<<"ERREUR: Impossible d'envoyer le message"<<endl;
00067                                 break;
00068                         }
00069                         case 7:{
00070                                 cerr<<"ERREUR: Impossible de recevoir le message"<<endl;
00071                                 break;
00072                         }
00073                         case 8:{
00074                                 cerr<<"ERREUR: Destinataire du message inconnu"<<endl;
00075                                 break;
00076                         }
00077                         case 9:{
00078                                 cerr<<"ERREUR: Extrémitée déconnecté"<<endl;
00079                                 break;
00080                         }
00081                         default:{
00082                                 cerr<<"ERREUR: inconnue"<<endl;
00083                         }
00084                 }
00085         }
00086 private:
00090         int mCause;
00091 };
00092 
00093 #endif

Generated on Wed Jan 2 14:01:41 2008 for Pacman by  doxygen 1.5.1