Index: source/ariba/utility/transport/asio/bluetooth_endpoint.hpp
===================================================================
--- source/ariba/utility/transport/asio/bluetooth_endpoint.hpp	(revision 5406)
+++ source/ariba/utility/transport/asio/bluetooth_endpoint.hpp	(revision 5410)
@@ -175,5 +175,5 @@
 
 template<typename X>
-bdaddr_t bluetooth_endpoint<X>::addr_any = (bdaddr_t) { {0, 0, 0, 0, 0, 0}};
+bdaddr_t bluetooth_endpoint<X>::addr_any = (const bdaddr_t) { {0u, 0u, 0u, 0u, 0u, 0u} };
 
 }}} // namespace boost::asio::bluetooth
Index: source/ariba/utility/transport/rfcomm/rfcomm.cpp
===================================================================
--- source/ariba/utility/transport/rfcomm/rfcomm.cpp	(revision 5406)
+++ source/ariba/utility/transport/rfcomm/rfcomm.cpp	(revision 5410)
@@ -104,5 +104,4 @@
 void rfcomm::stop() {
 	logging_info( "Stopping asio rfcomm" );
-
 }
 
@@ -175,9 +174,6 @@
 	for (size_t i = 0; i < links.size(); i++)
 		if (links[i]->remote.mac() == endpoint.mac()) {
-
 			// close socket
-			links[i]->socket.cancel();
-			links[i]->socket.close();
-			links[i]->up = false;
+			shutdown(links[i]);
 			break;
 		}
@@ -208,5 +204,4 @@
 		logging_error( "Error waiting for new connections: " << error
 				<< ", trying to recover (attempt " << accept_retries << ")");
-		delete info;
 
 		// restart accepting
@@ -214,5 +209,7 @@
 			accept_retries++;
 			start_accept();
-		}
+		} else
+			delete info;
+
 		return;
 	}
@@ -343,5 +340,6 @@
 
 	// wait for all data to be received
-	if (bytes != info->size) return;
+	if (bytes != info->size)
+		return;
 
 	logging_debug( "Received message of size " << info->size );
@@ -363,5 +361,5 @@
 	if (info->sending || !info->up || info->send_buffer.size()==0) return;
 
-	cout << "Sending messages..." << endl;
+	logging_debug("Sending messages ...");
 
 	// safely remove data from deque
@@ -391,15 +389,15 @@
 	link_info* info, size_t size, uint8_t* buffer ) {
 
-	// ignore errors and wait for all data to be sent
-	if (error || bytes != (size+4) ) {
-		if (error) {
-			logging_error( "Message sent error" );
-
-			// close socket
-			info->socket.close();
-			info->up = false;
-		}
-		return;
-	}
+	// handle error
+	if (error) {
+		logging_error( "Message sent error" );
+		shutdown(info);
+		return;
+	}
+
+	//  wait for all data to be sent
+	if (bytes != (size+4) )
+		return;
+
 	logging_debug( "Message sent" );
 
