From f3ed74b84f202774dd0f5ef6231bcc93eef4cc56 Mon Sep 17 00:00:00 2001 From: glenux Date: Tue, 10 Jan 2006 12:16:59 +0000 Subject: [PATCH] --- src/xsock.h | 6 ++--- src/xsock_errors.h | 50 ++++++++++++++++++++------------------ src/xsock_tcp.cpp | 2 +- src/xsock_udp.cpp | 2 +- src/xsock_udp_reliable.cpp | 2 +- 5 files changed, 32 insertions(+), 30 deletions(-) diff --git a/src/xsock.h b/src/xsock.h index bc88633..80c017a 100644 --- a/src/xsock.h +++ b/src/xsock.h @@ -6,9 +6,9 @@ #ifndef _XIONFS_XSOCK #define _XIONFS_XSOCK 1 -#include "XSock_errors.h" -#include "XSock_global.h" -#include "XSock_iface.h" +#include "xsock_errors.h" +#include "xsock_global.h" +#include "xsock_iface.h" using namespace std; using namespace XSockExcept; diff --git a/src/xsock_errors.h b/src/xsock_errors.h index c20881f..5bacd53 100644 --- a/src/xsock_errors.h +++ b/src/xsock_errors.h @@ -1,31 +1,33 @@ #ifndef _XSOCK_ERRORS #define _XSOCK_ERRORS 1 +#include + namespace XSockExcept { - class eXSockExcept { }; - class eInvalidSocket : eXSockExcept { }; - class eUnknownProtocol : eXSockExcept { }; - class eUnableToListen : eXSockExcept { }; - class eUnableToConnect : eXSockExcept { }; - class eUnableToAccept : eXSockExcept { }; - class eUnableToBind : eXSockExcept { }; - class eSockUnreadable : eXSockExcept { }; - class eSockUnwritable : eXSockExcept { }; - class eUnknownXSockRole : eXSockExcept { }; - class eUnableToResolveName : eXSockExcept { }; - class eXSockNotReady : eXSockExcept { }; - class eConnectionClosedByPeer : eXSockExcept { }; - class eDeadLock : eXSockExcept { }; - class eUnableToLock : eXSockExcept { }; - class eUnableToUnlock : eXSockExcept { }; - class eUnableToCloseFile : eXSockExcept { }; - class eUnableToOpenFile : eXSockExcept { }; - class eUnableToStatFile : eXSockExcept { }; - class eUnableToOpen2ndFile : eXSockExcept { }; - class eUnableToCreateFile : eXSockExcept { }; - class eUnableToDeleteFile : eXSockExcept { }; - class eUnableToReadFile : eXSockExcept { }; - class eUnableToWriteFile : eXSockExcept { }; + class eXSockExcept : public std::exception { }; + class eInvalidSocket : public eXSockExcept { }; + class eUnknownProtocol : public eXSockExcept { }; + class eUnableToListen : public eXSockExcept { }; + class eUnableToConnect : public eXSockExcept { }; + class eUnableToAccept : public eXSockExcept { }; + class eUnableToBind : public eXSockExcept { }; + class eSockUnreadable : public eXSockExcept { }; + class eSockUnwritable : public eXSockExcept { }; + class eUnknownXSockRole : public eXSockExcept { }; + class eUnableToResolveName : public eXSockExcept { }; + class eXSockNotReady : public eXSockExcept { }; + class eConnectionClosedByPeer : public eXSockExcept { }; + class eDeadLock : public eXSockExcept { }; + class eUnableToLock : public eXSockExcept { }; + class eUnableToUnlock : public eXSockExcept { }; + class eUnableToCloseFile : public eXSockExcept { }; + class eUnableToOpenFile : public eXSockExcept { }; + class eUnableToStatFile : public eXSockExcept { }; + class eUnableToOpen2ndFile : public eXSockExcept { }; + class eUnableToCreateFile : public eXSockExcept { }; + class eUnableToDeleteFile : public eXSockExcept { }; + class eUnableToReadFile : public eXSockExcept { }; + class eUnableToWriteFile : public eXSockExcept { }; /* définition des exceptions ici */ } diff --git a/src/xsock_tcp.cpp b/src/xsock_tcp.cpp index 1d8129c..bb264bc 100644 --- a/src/xsock_tcp.cpp +++ b/src/xsock_tcp.cpp @@ -1,5 +1,5 @@ -#include "XSock.h" +#include "xsock.h" #define VERBOSE 0 #define VERBOSETCP 0 diff --git a/src/xsock_udp.cpp b/src/xsock_udp.cpp index 9c49b3d..f5e5a36 100644 --- a/src/xsock_udp.cpp +++ b/src/xsock_udp.cpp @@ -1,5 +1,5 @@ -#include "XSock.h" +#include "xsock.h" // constantes utilisées dans XSock.cpp et dans XSockUDP.cpp #define NBPORTSPUB 64512 diff --git a/src/xsock_udp_reliable.cpp b/src/xsock_udp_reliable.cpp index dcc9171..f3c42f9 100644 --- a/src/xsock_udp_reliable.cpp +++ b/src/xsock_udp_reliable.cpp @@ -1,5 +1,5 @@ -#include "XSock.h" +#include "xsock.h" // constantes utilisées dans XSock.cpp et dans XSockUDP_RELIABLE.cpp #define NBPORTSPUB 64512