Details
-
Type:
Story
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: ts_middleware
-
Labels:
-
Story Points:1
-
Epic Link:
-
Sprint:TSSW Sprint - May 09 - May 23
-
Team:Telescope and Site
-
Urgent?:No
Description
OneClientServer in ts_tcpip will fail to call connect_callback under the following circumstances:
- A client connects (connect_callback correctly called)
- The client drops the connection. OneClientServer does not call connect_callback, as documented, because it doesn't monitor the client connection.
- A client connects. Here is where the problem arises. The last time connect_callback was called the connection was live, and the code recorded that. Now it's alive again, so it thinks the state has not changed and has no need to call connect_callback.
Two solutions that come to mind (which might go together):
- Monitor the connection. This would be nice for users but introduces some delay (depending on the polling frequency).
- Whenever a client tries to connect record the new connection state (like monitoring, but less frequent and still will not call the connection callback when a connection is lost).
These two might work best together.
I decided to implement both solutions:
Also it turns out that write-only servers do not need to monitor reader in order to notice that the client has dropped the connection. I updated the docs accordingly
Pull request: https://github.com/lsst-ts/ts_tcpip/pull/12