nthallen / monarch

Monarch Data Acquisition System
0 stars 1 forks source link

cmd gets TIME_WAIT #126

Open nthallen opened 4 years ago

nthallen commented 4 years ago

This is a specific instance of #83.

Command clients, specifically cmd_reader and cmd_writer, need to close their connection to the server before the server closes theirs in order to prevent the server from being hit with the TIME_WAIT. This requires both to recognize a Quit command.

This is tricky with cmd_writer, which generally operates using a private Loop for sending commands synchronously. Perhaps this client needs to be on more than one Loop, one for synchronous transmission and another for asynchronous quit processing.

cmd_reader is always handling asynchronous reception, so this should not be an issue.