/*
* Send the packet indicating the end of the communication to the socket
* on the other side.
*/
EndPacket endPacket = new EndPacket();
packetBuffer.add(endPacket);
packetQueue.add(endPacket);
// Stop the communication with the software using the socket.
disconnectFromSoftware();