Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Carob on a Mac: msg#00003

db.carob.general

Subject: Re: Carob on a Mac

(re-send because carob-Tt5JLJuBijYiZlD9aYmxOGD2FQJk+8+b@xxxxxxxxxxxxxxxx (550
unknown user) => ???)

Hi Ian,
So, for one email, you get three in return... good investment :)

Mine is about signals:
We can definitly *not* modify the message handler because we are a library... otherwise we must set it before each send() and put the old one back just after... "oh la la" :)
For freebsd and MacOs (>10.2), there seems to be an equivalent: SO_NOSIGPIPE
This flag must be set at socket creation time by setsockopt but should be what we are looking for.
An solution proposed by Marc, which is quite elegant (I mean, the solution ;) ) could be to define 2 global variables in a system-definitions.hpp: one for socket options, one for send() flags

Everybody ? comments ?

Ian Holsman a écrit :

Hi.

I am trying to get carob running on my mac, and have had the following issues:

- gnu's c++ locale only works when you use glibc, (which OS/X doesn't, but default it uses UTF8)
- MSG_NOSIGNAL doesn't exist on OS/X. so I am replacing the signal handler instead.

here is the diff so far...
it doesn't pass all the tests, but the 'read_example' runs.

the output of carobTestLauncher is
1) test: encode_decode (E)
uncaught exception of unknown type

(and I disabled the locale test, as it won't work without glibc's locale)

libmysequoia isn't fairing as well I'm afraid .. 13/18 tests are failing ;(




Helios:/src/java/continuent/carob/src ianh$ cvs diff
Index: Common.cpp
===================================================================
RCS file: /cvsroot/carob/carob/src/Common.cpp,v
retrieving revision 1.18
diff -u -r1.18 Common.cpp
--- Common.cpp 19 Dec 2005 18:32:03 -0000 1.18
+++ Common.cpp 4 Jan 2006 01:58:58 -0000
@@ -36,7 +36,8 @@
// TODO: it would be nice to be able to get this at runtime
// (in a non-portable way quite obviously...)
// On linux try "locale -a"
-#define NAME_OF_ANY_UTF8_LOCALE_AVAILABLE "en_US.utf8"
+//#define NAME_OF_ANY_UTF8_LOCALE_AVAILABLE "en_US.utf8"
+#define NAME_OF_ANY_UTF8_LOCALE_AVAILABLE "C"

void CarobNS::setLogLevel(const LogLevel l)
{
Index: Connection.cpp
===================================================================
RCS file: /cvsroot/carob/carob/src/Connection.cpp,v
retrieving revision 1.48
diff -u -r1.48 Connection.cpp
--- Connection.cpp 30 Dec 2005 17:23:40 -0000 1.48
+++ Connection.cpp 4 Jan 2006 01:58:59 -0000
@@ -26,7 +26,18 @@
using std::wstring;

using namespace CarobNS;
-
+static void UNIXIgnoreSIGPIPE(void)
+{
+ int err;
+ struct sigaction signalState;
+ err = sigaction(SIGPIPE, NULL, &signalState);
+// err = MoreUNIXErrno(err);
+ if (err == 0) {
+ signalState.sa_handler = SIG_IGN;
+ err = sigaction(SIGPIPE, &signalState, NULL);
+// err = MoreUNIXErrno(err);
+ }
+}
Connection::Connection(const ConnectionParameters& prms)
throw (ConnectionException, AuthenticationException, UnexpectedException) :
isClosed(true),
@@ -35,6 +46,7 @@
writeExecutedInTransaction(false),
mustBeginTransaction(false)
{
+ UNIXIgnoreSIGPIPE();
wstring fctName(L"Connection::Connection");
if (isInfoEnabled())
{
Index: JavaSocket.cpp
===================================================================
RCS file: /cvsroot/carob/carob/src/JavaSocket.cpp,v
retrieving revision 1.26
diff -u -r1.26 JavaSocket.cpp
--- JavaSocket.cpp 22 Dec 2005 14:58:56 -0000 1.26
+++ JavaSocket.cpp 4 Jan 2006 01:58:59 -0000
@@ -30,6 +30,11 @@

using namespace CarobNS;

+#ifndef MSG_NOSIGNAL
+#define MSG_NOSIGNAL 0
+//MSG_NOSIGNAL needs a sigpipe handler set to null setup!
+#endif
+
JavaSocket::JavaSocket() :
socketFd(-1),
connected(false)


_______________________________________________
Carob mailing list
Carob-RyYwo1q5J+pm4DMUGMHt/jIQnlzKTOB+HZ5vskTnxNA@xxxxxxxxxxxxxxxx
https://forge.continuent.org/mailman/listinfo/carob


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | advertise | OSDir is an inevitable website. super tiny logo