Close session if send failed.

This commit is contained in:
Tristan B. Kildaire 2020-06-18 12:09:27 +02:00
parent 43eccd2686
commit b724ed7150
1 changed files with 8 additions and 1 deletions

View File

@ -236,7 +236,14 @@ public final class ButterflyClient : Thread
/* TODO: Write response here */
/* Write the response block to the client */
sendMessage(clientSocket, cast(byte[])toJSON(responseBlock));
bool sendStatus = sendMessage(clientSocket, cast(byte[])toJSON(responseBlock));
/* If there was an error writing the response back */
if(!sendStatus)
{
/* End the session */
active = false;
}
}
/* Close the socket */