Commit bf0727c3 authored by Lubomir Bulej's avatar Lubomir Bulej

Call shutdown() on socket before close() in DiSL and Shadow VM agents

This is to ensure that data that may still be in socket
buffers when close() is called are sent to the other side.
This mainly applies to the Shadow VM agent, because it only
sends data to the Shadow VM server and does not expect any
reply, but it is probably a good practice in general.
parent a4161a17
......@@ -78,6 +78,7 @@ connection_close (struct connection * connection) {
connection->sockfd, connection->sent_bytes, connection->recv_bytes
);
shutdown (connection->sockfd, SHUT_RDWR);
close (connection->sockfd);
free (connection);
}
......
......@@ -1137,6 +1137,7 @@ static void close_connection(int conn, jlong thread_id) {
_buffs_release(buffs);
// close socket
shutdown(conn, SHUT_RDWR);
close(conn);
}
static void * send_thread_loop(void * obj) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment