The Target Machine has Windows 8.1 installed, Host Machine has Windows 7 installed (but the Host OS has nothing to do with connection error). I'm using the Debugger of the Windows 8.1 SDK package.
Settings on Target Machine
bcdedit /debug on
bdcedit /dbgsettings net hostip:xx.xx.xx.xx port:xxxxx
bcdedit /set {dbgsettings} busparams x.y.z
After that, I rebooted the Target Machine.
Error Log
The transport connection between host kernel debugger and target windows seems lost. Please try resync with the target, recycle the host debugger or reboot the target windows.
... Retry sending the same data packet for 10884 times.
... Retry sending the same data packet for 10997 times.
>>>>**WinSock write error. Error 0n10040**
>>>>WriteAll(0x00002738,0x00000003,1304,0) fails.
>>>>WritePacketContents failed. Status == 0x2738
I also looked at above Error code meaning
10040 WSAEMSGSIZE Message too long
A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram was smaller than the datagram itself.
but I'm not sure how to fix it.