harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r943838 - /harmony/enhanced/java/trunk/jdktools/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.cpp
Date Thu, 13 May 2010 07:59:02 GMT
Author: hindessm
Date: Thu May 13 07:59:02 2010
New Revision: 943838

URL: http://svn.apache.org/viewvc?rev=943838&view=rev
Log:
Matching JDWP spec which says:

  The handshake process has the following steps:
    * The debugger side sends 14 bytes to the VM side, consisting of
      the 14 ASCII characters of the string "JDWP-Handshake".
    * The VM side replies with the same 14 bytes: JDWP-Handshake

which implies that the jdwp agent should wait for the debugger to send
the string first and then reply.

Modified:
    harmony/enhanced/java/trunk/jdktools/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.cpp

Modified: harmony/enhanced/java/trunk/jdktools/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/jdktools/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.cpp?rev=943838&r1=943837&r2=943838&view=diff
==============================================================================
--- harmony/enhanced/java/trunk/jdktools/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.cpp
(original)
+++ harmony/enhanced/java/trunk/jdktools/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.cpp
Thu May 13 07:59:02 2010
@@ -224,12 +224,6 @@ CheckHandshaking(jdwpTransportEnv* env, 
     jlong deadline = (handshakeTimeout == 0) ? 0 : (jlong)GetTickCount() + handshakeTimeout;
 
     jdwpTransportError err;
-    err = SendData(env, sckt, handshakeString, (int)strlen(handshakeString), deadline);
-    if (err != JDWPTRANSPORT_ERROR_NONE) {
-        SetLastTranErrorMessagePrefix(env, "'JDWP-Handshake' sending error: ");
-        return err;
-    }
-
     err = ReceiveData(env, sckt, receivedString, (int)strlen(handshakeString), deadline);
     if (err != JDWPTRANSPORT_ERROR_NONE) {
         SetLastTranErrorMessagePrefix(env, "'JDWP-Handshake' receiving error: ");
@@ -241,6 +235,12 @@ CheckHandshaking(jdwpTransportEnv* env, 
         return JDWPTRANSPORT_ERROR_IO_ERROR;
     }
 
+    err = SendData(env, sckt, handshakeString, (int)strlen(handshakeString), deadline);
+    if (err != JDWPTRANSPORT_ERROR_NONE) {
+        SetLastTranErrorMessagePrefix(env, "'JDWP-Handshake' sending error: ");
+        return err;
+    }
+
     return JDWPTRANSPORT_ERROR_NONE;
 }// CheckHandshaking
 



Mime
View raw message