[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] conga/ricci/common ServerSocket.cpp



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	kupcevic sourceware org	2006-10-14 17:51:35

Modified files:
	ricci/common   : ServerSocket.cpp 

Log message:
	ricci: set SO_REUSEADDR on all server sockets

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/common/ServerSocket.cpp.diff?cvsroot=cluster&r1=1.3&r2=1.4

--- conga/ricci/common/ServerSocket.cpp	2006/08/10 22:53:07	1.3
+++ conga/ricci/common/ServerSocket.cpp	2006/10/14 17:51:35	1.4
@@ -45,6 +45,12 @@
     throw m;
   }
   
+  int dummy_true = 1;
+  if (setsockopt(_sock, SOL_SOCKET, SO_REUSEADDR, &dummy_true, sizeof(dummy_true))) {
+    String m = String("ServerSocket(sock_path=") + sock_path + "): set SO_REUSEADDR, failed, errno=" + errno;
+    throw m;
+  }
+  
   struct sockaddr_un {
     sa_family_t  sun_family;
     char         sun_path[100];
@@ -78,6 +84,12 @@
     throw m;
   }
   
+  int dummy_true = 1;
+  if (setsockopt(_sock, SOL_SOCKET, SO_REUSEADDR, &dummy_true, sizeof(dummy_true))) {
+    String m = String("ServerSocket(port=") + port + "): set SO_REUSEADDR, failed, errno=" + errno;
+    throw m;
+  }
+  
   struct sockaddr_in addr;
   addr.sin_family = AF_INET;
   addr.sin_port = htons(port);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]