Skip to content

Commit ecbbe96

Browse files
committed
Waiting the remaining tcp data are sent
So that the tcp socket are closed by debugger client first and the debugger client won't receive socket are closed by remote error JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo [email protected]
1 parent 90d206d commit ecbbe96

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

jerry-ext/debugger/debugger-tcp.c

+10
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@ jerryx_debugger_tcp_close (jerry_debugger_transport_header_t *header_p) /**< tcp
131131

132132
jerryx_debugger_transport_tcp_t *tcp_p = (jerryx_debugger_transport_tcp_t *) header_p;
133133

134+
/**
135+
* Waiting the remaining tcp data are sent, so that the tcp socket are
136+
* closed by debugger client first and the debugger client won't receive
137+
* socket are closed by remote error
138+
*/
139+
for (int i = 0; i < 5; i += 1)
140+
{
141+
jerry_debugger_transport_sleep ();
142+
}
143+
134144
JERRYX_DEBUG_MSG ("TCP connection closed.\n");
135145

136146
jerryx_debugger_tcp_close_socket (tcp_p->tcp_socket);

0 commit comments

Comments
 (0)