Date: Tuesday, December 5, 2006 @ 12:06:10
Author: gilles
Path: /cvsroot/carob/carob
Modified: include/Common.hpp (1.48 -> 1.49)
include/ConnectionParameters.hpp (1.32 -> 1.33)
src/ConnectionParameters.cpp (1.26 -> 1.27)
src/ControllerPingSender.cpp (1.2 -> 1.3)
src/ControllerWatcher.cpp (1.6 -> 1.7)
Replaced PING and PONG constants by CONTROLLER_PING_VERSION (0x01)
Related to CAROB-110
Changed default ping delay to 1000 (1s)
----------------------------------+
include/Common.hpp | 4 ++++
include/ConnectionParameters.hpp | 2 +-
src/ConnectionParameters.cpp | 2 +-
src/ControllerPingSender.cpp | 2 +-
src/ControllerWatcher.cpp | 6 +++---
5 files changed, 10 insertions(+), 6 deletions(-)
Index: carob/include/Common.hpp
diff -u carob/include/Common.hpp:1.48 carob/include/Common.hpp:1.49
--- carob/include/Common.hpp:1.48 Tue Nov 28 16:54:20 2006
+++ carob/include/Common.hpp Tue Dec 5 12:06:10 2006
@@ -62,6 +62,10 @@
};
/**
+ * Controller ping constants
+ */
+const java_byte CONTROLLER_PING_VERSION = 0x01;
+/**
* Utility class to convert a plain text log level into the internaly defined
* log level code
*/
Index: carob/include/ConnectionParameters.hpp
diff -u carob/include/ConnectionParameters.hpp:1.32
carob/include/ConnectionParameters.hpp:1.33
--- carob/include/ConnectionParameters.hpp:1.32 Wed Nov 29 16:00:48 2006
+++ carob/include/ConnectionParameters.hpp Tue Dec 5 12:06:09 2006
@@ -46,7 +46,7 @@
static const std::wstring DEFAULT_DB;
/** Default policy = ROUND_ROBIN */
static const ConnectPolicy DEFAULT_POLICY;
- /** Default ping delay = 5000 ms */
+ /** Default ping delay = 1000 ms */
static const int DEFAULT_PING_DELAY;
/** Default controller timeout = 25000 ms */
static const int DEFAULT_CONTROLLER_TIMEOUT;
Index: carob/src/ConnectionParameters.cpp
diff -u carob/src/ConnectionParameters.cpp:1.26
carob/src/ConnectionParameters.cpp:1.27
--- carob/src/ConnectionParameters.cpp:1.26 Wed Nov 29 16:12:43 2006
+++ carob/src/ConnectionParameters.cpp Tue Dec 5 12:06:10 2006
@@ -35,7 +35,7 @@
const std::wstring ConnectionParameters::DEFAULT_PASSWD =
L"" ;
const std::wstring ConnectionParameters::DEFAULT_DB =
L"myDB" ;
const ConnectPolicy ConnectionParameters::DEFAULT_POLICY =
ROUND_ROBIN;
-const int ConnectionParameters::DEFAULT_PING_DELAY =
5000;
+const int ConnectionParameters::DEFAULT_PING_DELAY =
1000;
const int ConnectionParameters::DEFAULT_CONTROLLER_TIMEOUT =
25000;
const bool ConnectionParameters::DEFAULT_CONNECTION_PERSISTENCY =
false ;
const bool ConnectionParameters::DEFAULT_RETRIEVE_SQL_WARNINGS =
false ;
Index: carob/src/ControllerPingSender.cpp
diff -u carob/src/ControllerPingSender.cpp:1.2
carob/src/ControllerPingSender.cpp:1.3
--- carob/src/ControllerPingSender.cpp:1.2 Thu Nov 30 15:22:29 2006
+++ carob/src/ControllerPingSender.cpp Tue Dec 5 12:06:10 2006
@@ -57,7 +57,7 @@
if (isDebugEnabled())
logDebug(fctName, L"Pinger started");
java_byte packet[1];
- packet[0] = 0xB;
+ packet[0] = CONTROLLER_PING_VERSION;
while (!is_stopped)
{
std::vector<ControllerInfo> ctrls = controllers.getControllers();
Index: carob/src/ControllerWatcher.cpp
diff -u carob/src/ControllerWatcher.cpp:1.6 carob/src/ControllerWatcher.cpp:1.7
--- carob/src/ControllerWatcher.cpp:1.6 Mon Dec 4 15:13:48 2006
+++ carob/src/ControllerWatcher.cpp Tue Dec 5 12:06:10 2006
@@ -127,15 +127,15 @@
// This is really too much logs...
// if (isDebugEnabled())
// logDebug(fctName, L"Received response from " +
static_cast<wstring>(ctrl));
- if (buf[0] == 0xC)
+ if (buf[0] == CONTROLLER_PING_VERSION)
{
controllers_ptr->setControllerResponsed(ctrl, getCurrentTimeInMs());
}
else if (isDebugEnabled())
{
- logDebug(fctName, L"Wrong pong response from "
+ logDebug(fctName, L"Wrong ping version in response from "
+ static_cast<wstring>(ctrl) + L" was: " + toUserString(buf[0]) +
L", expected:"
- + toUserString(0xC));
+ + toUserString(CONTROLLER_PING_VERSION));
}
recLength = recvfrom(socket_fd, static_cast<void*>(buf), 1,
0, &respondingCtrlAddr, &respondingCtrlAddrLength);
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits