onet
onet copied to clipboard
Make API to change websockets write deadline (maybe other timeouts too)
Problem raised by @JoaoAndreSa
We use constant timeouts in tcp and websocket connections. For applications that send a lot of data or with a slow connection, the timeout needs to be adjusted. The only way to do it at the moment is to change the source code, which isn't ideal.
The expirationTime
might need to be adjusted too if the connection timeouts change, maybe a function of the connection timeout?
We could make the timeout bigger and the cache expiration at least as big as the timeout but it would only hide the fact that those caches should actually not act like a cache. Given specific conditions, it could happen the cache is cleaned in the middle of a protocol which is bad.
@jeffallen proposed to have a talk with @ineiti. One solution could be to cache resources by connection and clean it up when the connection is closed or it reached the timeout.