Index: trunk/FACT++/dim/README_v19.txt
===================================================================
--- trunk/FACT++/dim/README_v19.txt	(revision 13297)
+++ trunk/FACT++/dim/README_v19.txt	(revision 13339)
@@ -1,4 +1,4 @@
 
-                    DIM version 19.30 Release Notes
+                    DIM version 19.31 Release Notes
 
 Notes 1 and 2 for Unix Users only
@@ -17,5 +17,12 @@
 		Dns </dev/null >& dns.log &
 
-NOTE 3: The Version Number service provided by servers is now set to 1930.
+NOTE 3: The Version Number service provided by servers is now set to 1931.
+
+30/03/2012
+Changes for version 19.31:
+    - changed dna_write to dna_write_nowait for servers when removing a service and for clients
+      when releasing and subscribing to a service. Dna_write cannot be used for the same connection
+      as dna_write_nowait as it will mingle the packets.
+    - Removed more compiler warnings.
 
 14/03/2012
Index: trunk/FACT++/dim/dim/dim.h
===================================================================
--- trunk/FACT++/dim/dim/dim.h	(revision 13297)
+++ trunk/FACT++/dim/dim/dim.h	(revision 13339)
@@ -14,5 +14,5 @@
 #include "dim_common.h"
 
-#define DIM_VERSION_NUMBER 1930
+#define DIM_VERSION_NUMBER 1931
 
 #define MY_LITTLE_ENDIAN	0x1
Index: trunk/FACT++/dim/src/dic.c
===================================================================
--- trunk/FACT++/dim/src/dic.c	(revision 13297)
+++ trunk/FACT++/dim/src/dic.c	(revision 13339)
@@ -91,5 +91,5 @@
 {
 	dim_print_date_time();
-	printf(" - Bad ID received from server -> Packet received:\n");
+	printf("Bad ID received from server -> Packet received:\n");
 	printf("\tpacket->size = %d\n",vtohl(packet->size));
 	printf("\tpacket->service_id = %d\n",vtohl(packet->service_id));
@@ -160,5 +160,5 @@
 			dna_get_node_task(conn_id, node, task);
 			dim_print_date_time();
-			printf(" - Conn %d: Server %s on node %s Disconnected\n",
+			printf("Conn %d: Server %s on node %s Disconnected\n",
 				conn_id, task, node);
 			fflush(stdout);
@@ -362,5 +362,5 @@
 			dna_get_node_task(conn_id, node, task);
 			dim_print_date_time();
-			printf(" - Conn %d: Server %s on node %s Connected\n",
+			printf("Conn %d: Server %s on node %s Connected\n",
 				conn_id, task, node);
 			fflush(stdout);
@@ -1029,5 +1029,5 @@
 		dic_packet->service_id = htovl(service_id);
 		dic_packet->size = htovl(DIC_HEADER);
-		dna_write( conn_id, dic_packet, DIC_HEADER );
+		dna_write_nowait( conn_id, dic_packet, DIC_HEADER );
 		release_service( servp );
 		break;
@@ -1442,5 +1442,5 @@
 			{
 				dim_print_date_time();
-				printf(" - Conn %d, Server %s on node %s Connecting\n",
+				printf("Conn %d, Server %s on node %s Connecting\n",
 					conn_id, dic_connp->task_name, dic_connp->node_name);
 				fflush(stdout);
@@ -1478,5 +1478,5 @@
 				{
 					dim_print_date_time();
-					printf(" - Failed connecting to Server %s on node %s port %d\n",
+					printf("Failed connecting to Server %s on node %s port %d\n",
 						task_name, node_name, port);
 					fflush(stdout);
@@ -1830,5 +1830,12 @@
 	dic_packet->format = htovl(MY_FORMAT);
 	dic_packet->size = htovl(DIC_HEADER);
-	ret = dna_write(conn_id, dic_packet, DIC_HEADER);
+	ret = dna_write_nowait(conn_id, dic_packet, DIC_HEADER);
+	if(!ret)
+	{
+		dim_print_date_time();
+		printf(" Client Sending Service Request: Couldn't write to Conn %3d : Server %s@%s\n",
+			conn_id, Net_conns[conn_id].task, Net_conns[conn_id].node);
+		fflush(stdout);
+	}
 	return(ret);
 }
Index: trunk/FACT++/dim/src/dis.c
===================================================================
--- trunk/FACT++/dim/src/dis.c	(revision 13297)
+++ trunk/FACT++/dim/src/dis.c	(revision 13339)
@@ -1516,6 +1516,6 @@
 					Net_conns[conn_id].task, Net_conns[conn_id].node);
 			}
-		}
-		fflush(stdout);
+			fflush(stdout);
+		}
 		if(reqp->delay_delete > 1)
 		{
@@ -1560,6 +1560,10 @@
 	dis_packet->service_id = htovl(service_id);
 	dis_packet->size = htovl(DIS_HEADER);
-	if( !dna_write(reqp->conn_id, dis_packet, DIS_HEADER) ) 
-	{
+	if( !dna_write_nowait(reqp->conn_id, dis_packet, DIS_HEADER) ) 
+	{
+		dim_print_date_time();
+		printf(" Server Removing Service: Couldn't write to Conn %3d : Client %s@%s\n",
+			reqp->conn_id, Net_conns[reqp->conn_id].task, Net_conns[reqp->conn_id].node);
+		fflush(stdout);
 		release_conn(reqp->conn_id, 0, 0);
 	}
Index: trunk/FACT++/dim/src/examples/test_client.c
===================================================================
--- trunk/FACT++/dim/src/examples/test_client.c	(revision 13297)
+++ trunk/FACT++/dim/src/examples/test_client.c	(revision 13339)
@@ -57,5 +57,5 @@
 {
 	if(tag){}
-	printf("Received VERSION %x, %d\n", (long)buf, *size);
+	printf("Received VERSION %lx, %d\n", (long)buf, *size);
 }
 
Index: trunk/FACT++/dim/src/tcpip.c
===================================================================
--- trunk/FACT++/dim/src/tcpip.c	(revision 13297)
+++ trunk/FACT++/dim/src/tcpip.c	(revision 13339)
@@ -67,4 +67,5 @@
 #include <errno.h>
 #include <netdb.h>
+
 #endif
 
@@ -890,5 +891,7 @@
 	int path, val, ret_code, ret;
 	int a,b,c,d;
-	unsigned char ipaddr[4];
+/* Fix for gcc 4.6 "dereferencing type-punned pointer will break strict-aliasing rules"?!*/
+	unsigned char ipaddr_buff[4];
+	unsigned char *ipaddr = ipaddr_buff;
 	int host_number = 0;
 
