[GREENFOOT-369] PlayerData server connection
Currently, the rules for opening the socket connection to the storage server are: try once, once open then keep using the same connection, and never make a 2nd try to connect.
The idea behind the rule was to avoid continuing to try to connect when there's a long-term problem (our storage server is down, user's connection is down, user is behind firewall). But I think at the moment this will cause more problems than intended, especially in this circumstance:
- User connects, plays for a while
- Socket times out (I don't think I set the keep-alive flag)
- User comes to save, socket is dead, so data is lost
We should set the keep-alive flag, but we should probably also allow reconnects in these situations: so if the socket was open last time we looked, we should attempt reconnection once, but if the last connection attempt failed, we should not try again?
Issue metadata
- Issue type: Bug
- Priority: Medium
- Fix versions: 2.2.0