You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2010/05/13 09:59:02 UTC
svn commit: r943838 -
/harmony/enhanced/java/trunk/jdktools/modules/jpda/src/main/native/jdwp/common/transport/dt_socket/SocketTransport.cpp
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