Date: Monday, January 9, 2006 @ 18:37:52
  Author: gilles
    Path: /cvsroot/carob/carob/include

   Added: SystemDependantDefs.hpp (1.1)

(new file) definition of constants that must be tweaked per system/os/archi/...


-------------------------+
 SystemDependantDefs.hpp |   61 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 61 insertions(+)


Index: carob/include/SystemDependantDefs.hpp
diff -u /dev/null carob/include/SystemDependantDefs.hpp:1.1
--- /dev/null   Mon Jan  9 18:37:52 2006
+++ carob/include/SystemDependantDefs.hpp       Mon Jan  9 18:37:52 2006
@@ -0,0 +1,61 @@
+/*
+ * Sequoia: Database clustering technology.
+ * Copyright (C) 2005-2006 Continuent, Inc.
+ * Contact: [EMAIL PROTECTED]
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Initial developer(s): Gilles Rayrat
+ * Contributor(s): 
+ */
+#ifndef SYSTEMDEPENDANTDEFS_HPP_
+#define SYSTEMDEPENDANTDEFS_HPP_
+
+//TODO: Add #ifdefs for each supported archi
+
+namespace
+{
+
+////////////////////////////////////////////////////////////////////////////////
+// Sockets options
+/**
+ * Communication domain for socket creation. This selects the protocol family
+ * which will be used for communications. Defined in <sys/socket.h> or
+ * "man 2 socket" for more info
+ */
+const int SOCKET_CREATION_DOMAIN          = PF_INET;
+// const int SOCKET_CREATION_DOMAIN          = PF_INET6;  //for IPv6
+
+////////////////////////////
+// Config: *nix (default) //
+////////////////////////////
+
+/** Socket options at socket level. Set just after socket creation. */
+const int SOCKET_SOL_OPTIONS              = SO_REUSEADDR;
+/** Send options. *nixes systems can use MSG_NOSIGNAL to avoid sigpipe when
+    socket is written/read while closed */
+const int SOCKET_SEND_FLAGS               = MSG_NOSIGNAL;
+
+///////////////////////////////////////////////////
+// Config: MacOS/X (ok?) - FreeBSD (to be tested) //
+///////////////////////////////////////////////////
+// #ifndef SO_NOSIGPIPE
+// Not present in 10.1.x kernel/headers
+// #define SO_NOSIGPIPE 0x1022
+// #endif
+
+// const int SOCKET_SOL_OPTIONS              = SO_REUSEADDR|SO_NOSIGPIPE;
+// const int SOCKET_SEND_FLAGS               = 0;
+
+}; //anonymous namespace
+#endif /*SYSTEMDEPENDANTDEFS_HPP_*/

_______________________________________________
Carob-commits mailing list
[email protected]
https://forge.continuent.org/mailman/listinfo/carob-commits

Reply via email to