Date: Monday, January 9, 2006 @ 18:39:03
Author: gilles
Path: /cvsroot/carob/carob/src
Modified: JavaSocket.cpp (1.28 -> 1.29)
Now use system dependant constants for socket creation, options and writing
----------------+
JavaSocket.cpp | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
Index: carob/src/JavaSocket.cpp
diff -u carob/src/JavaSocket.cpp:1.28 carob/src/JavaSocket.cpp:1.29
--- carob/src/JavaSocket.cpp:1.28 Mon Jan 9 14:44:12 2006
+++ carob/src/JavaSocket.cpp Mon Jan 9 18:39:03 2006
@@ -25,6 +25,7 @@
#include "Common.hpp"
#include "JavaSocket.hpp"
+#include "SystemDependantDefs.hpp"
using std::wstring;
@@ -49,7 +50,7 @@
wstring fctName(L"JavaSocket::Create");
if (isVerboseEnabled())
logVerbose(fctName, L"Creating socket...");
- socketFd = socket(AF_INET,
+ socketFd = socket(SOCKET_CREATION_DOMAIN,
SOCK_STREAM,
0);
@@ -62,7 +63,7 @@
}
int opt_value = 1;
- if (setsockopt(socketFd, SOL_SOCKET, SO_REUSEADDR,
+ if (setsockopt(socketFd, SOL_SOCKET, SOCKET_SOL_OPTIONS,
(const char*) &opt_value, sizeof (opt_value)) == -1
||
setsockopt(socketFd, IPPROTO_TCP, TCP_NODELAY,
@@ -195,11 +196,11 @@
int32_t netlen = htonl(utf8str.length());
//First write number of bytes to follow as
- if (sendToSocket(fctName, L"UTF string", &netlen, sizeof(netlen),
MSG_NOSIGNAL))
+ if (sendToSocket(fctName, L"UTF string", &netlen, sizeof(netlen),
SOCKET_SEND_FLAGS))
{
if (isVerboseEnabled())
logVerbose(fctName, L"Ok. Sending string");
- sendToSocket(fctName, L"UTF string", utf8str.data(), utf8str.length(),
MSG_NOSIGNAL);
+ sendToSocket(fctName, L"UTF string", utf8str.data(), utf8str.length(),
SOCKET_SEND_FLAGS);
}
return utf8str.length();
@@ -242,7 +243,7 @@
wstring fctName(L"JavaSocket::WriteInt32");
// we have to convert the byte order
int32_t conv = htonl(i);
- sendToSocket(fctName, L"Int32", &conv, sizeof(conv), MSG_NOSIGNAL);
+ sendToSocket(fctName, L"Int32", &conv, sizeof(conv), SOCKET_SEND_FLAGS);
}
void JavaSocket::readJavaInt(int32_t& i) const throw (SocketIOException,
@@ -265,7 +266,7 @@
wstring fctName(L"JavaSocket::writeJavaLong");
// we have to convert the byte order
int64_t conv = htonl(i);
- sendToSocket(fctName, L"Int64", &conv, sizeof(conv), MSG_NOSIGNAL);
+ sendToSocket(fctName, L"Int64", &conv, sizeof(conv), SOCKET_SEND_FLAGS);
}
void JavaSocket::readJavaLong(int64_t& i) const throw (SocketIOException,
@@ -289,7 +290,7 @@
uint8_t byteToSend = b; // the implicit casts do it right
//No byte order problem here: the only value read is '0' for false
//all other values are true
- sendToSocket(fctName, L"Boolean", &byteToSend, sizeof(byteToSend),
MSG_NOSIGNAL);
+ sendToSocket(fctName, L"Boolean", &byteToSend, sizeof(byteToSend),
SOCKET_SEND_FLAGS);
}
void JavaSocket::readJavaBool(bool& b) const throw (SocketIOException,
_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits