Date: Wednesday, November 29, 2006 @ 20:29:00
Author: gilles
Path: /cvsroot/carob/carob
Modified: include/JavaSocket.hpp (1.33 -> 1.34) src/JavaSocket.cpp (1.56
-> 1.57)
Removed exception thrown in destructor (this was very bad...)
Just catch and log error on socket closure
------------------------+
include/JavaSocket.hpp | 2 +-
src/JavaSocket.cpp | 12 ++++++++++--
2 files changed, 11 insertions(+), 3 deletions(-)
Index: carob/include/JavaSocket.hpp
diff -u carob/include/JavaSocket.hpp:1.33 carob/include/JavaSocket.hpp:1.34
--- carob/include/JavaSocket.hpp:1.33 Tue Nov 28 17:07:55 2006
+++ carob/include/JavaSocket.hpp Wed Nov 29 20:29:00 2006
@@ -55,7 +55,7 @@
* Destructor for disconnection - closes the socket.
* @throws SocketIOException
*/
- virtual ~JavaSocket() throw (SocketIOException, UnexpectedException);
+ virtual ~JavaSocket();
/**
* Gives socket validity status.
* @return true if the socket is valid (has been created) so it can be
Index: carob/src/JavaSocket.cpp
diff -u carob/src/JavaSocket.cpp:1.56 carob/src/JavaSocket.cpp:1.57
--- carob/src/JavaSocket.cpp:1.56 Tue Nov 28 17:07:55 2006
+++ carob/src/JavaSocket.cpp Wed Nov 29 20:29:00 2006
@@ -45,12 +45,20 @@
{
}
-JavaSocket::~JavaSocket() throw (SocketIOException, UnexpectedException)
+JavaSocket::~JavaSocket()
{
wstring fctName(L"JavaSocket::~JavaSocket");
if (isDebugEnabled())
logDebug(fctName, L"About to close socket...");
- closeSocket();
+ try
+ {
+ closeSocket();
+ }
+ catch (SocketIOException e)
+ {
+ if (isInfoEnabled())
+ logInfo(fctName, L"Socket closure failed. Exception is: " +
e.description());
+ }
}
void JavaSocket::create(int domain)
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits