Index: branches/network/src/lib/network/handshake.cc
===================================================================
--- branches/network/src/lib/network/handshake.cc	(revision 7776)
+++ branches/network/src/lib/network/handshake.cc	(revision 7777)
@@ -79,5 +79,6 @@
         localState.error = 1;
         localState.completed = 1;
-        localState.errorString = "Seems not to be orxonox!";
+        PRINTF(0)("orxId: %d:%d", remoteState.orxId, _ORXONOX_ID);
+        localState.errorString = "Seems not to be orxonox!\n";
         return;
       }
@@ -93,5 +94,6 @@
         localState.error = 2;
         localState.completed = 1;
-        localState.errorString = "Versions of server and client do not match!";
+        PRINTF(0)("version: %d:%d", remoteState.version, _ORXONOX_VERSION);
+        localState.errorString = "Versions of server and client do not match!\n";
         return;
       }
Index: branches/network/src/lib/network/handshake.h
===================================================================
--- branches/network/src/lib/network/handshake.h	(revision 7776)
+++ branches/network/src/lib/network/handshake.h	(revision 7777)
@@ -39,4 +39,5 @@
     inline int        getMessageManagerId(){ return remoteState.messageManagerId; }
     inline void       doReject( std::string reason ){ localState.error = 1; localState.errorString = "the server rejected your connection ["+ reason +"]"; }
+    inline std::string getErrorString(){ return remoteState.errorString; }
     
     virtual void varChangeHandler( std::list<int> & id );
Index: branches/network/src/lib/network/network_stream.cc
===================================================================
--- branches/network/src/lib/network/network_stream.cc	(revision 7776)
+++ branches/network/src/lib/network/network_stream.cc	(revision 7777)
@@ -341,5 +341,5 @@
             handleNewClient( it->second.userId );
 
-          PRINT(0)("handshake finished id=%d\n", it->second.handshake->getNetworkGameManagerId());
+          PRINTF(0)("handshake finished id=%d\n", it->second.handshake->getNetworkGameManagerId());
 
           delete it->second.handshake;
@@ -349,6 +349,10 @@
         else
         {
-          PRINT(1)("handshake failed!\n");
+          PRINTF(1)("handshake failed: %s!\n", it->second.handshake->getErrorString().c_str());
           it->second.socket->disconnectServer();
+          it->second.socket = NULL;
+          
+          delete it->second.handshake;
+          it->second.handshake = NULL;
         }
       }
@@ -422,9 +426,13 @@
     }
     
-    NETPRINTF(n)("adsf\n");
+    NETPRINTF(0)("adsf\n");
     
     assert( Converter::intToByteArray( offset, buf, INTSIZE ) == INTSIZE );
     
+    NETPRINTF(0)("adsf %d\n", offset);
+    
     assert( peer->second.socket->writePacket( buf, offset ) );
+    
+    NETPRINTF(0)("adsf\n");
     
     //peer->second.connectionMonitor->processUnzippedOutgoingPacket( buf, offset, currentState );
Index: branches/network/src/lib/network/udp_socket.cc
===================================================================
--- branches/network/src/lib/network/udp_socket.cc	(revision 7776)
+++ branches/network/src/lib/network/udp_socket.cc	(revision 7777)
@@ -17,4 +17,5 @@
 #include "udp_server_socket.h"
 
+#include "network_log.h"
 
 void UdpSocket::init( )
@@ -151,26 +152,42 @@
 bool UdpSocket::writePacket( byte * data, int length )
 {
+  NETPRINTF(0)("adsf\n");
   if ( serverSocket )
   {
+    NETPRINTF(0)("adsf\n");
     NetworkPacket networkPacket;
     networkPacket.length = length;
     networkPacket.data = data;
+    NETPRINTF(0)("adsf\n");
     if ( !serverSocket->sendPacket( networkPacket, this->userId ) )
     {
+      NETPRINTF(0)("adsf\n");
       bOk = false;
       return false;
     }
     else
+    {
+      NETPRINTF(0)("adsf\n");
       return true;
+    }
+    NETPRINTF(0)("adsf\n");
   }
   else
   {
+    if ( !socket )
+      return false;
+    
+    NETPRINTF(0)("adsf\n");
     assert( length <= packet->maxlen );
     
+    NETPRINTF(0)("adsf\n");
     memcpy( packet->data, data, length );
+    NETPRINTF(0)("adsf\n");
     packet->len = length;
     
+    NETPRINTF(0)("adsf\n");
     if ( SDLNet_UDP_Send( socket, 1, packet) == 0 )
     {
+      NETPRINTF(0)("adsf\n");
       PRINTF(1)("SDLNet_UDP_Send: %s\n", SDLNet_GetError());
       bOk = false;
@@ -178,6 +195,8 @@
     }
     
+    NETPRINTF(0)("adsf\n");
     return true;
   }
+  NETPRINTF(0)("adsf\n");
 }
 
