Hi,
I am using the Python API for gpsd and I am struggling with the fact that after a while the fixes I get are not fresh. The docĀ warns about this: "You must poll the socket more often that that", explaining that there is a socket buffer that we should read with a certain frequency.
After setting a poll frequency to "once every 0.3s" the problem goes away, initially. After a period that can vary between several minutes to several hours - the buffering starts again, and even though I read every 0.3s, I end up getting fixes that are 5min old.
What is the recommended way of getting a fresh TPV report once a minute?
For example, perhaps one could call fflush on the underlying unix socket and then issue a `next()` call? The idea is to discard whatever is in the buffer and use the result of the next read operation. However, I found that Python does not expose `fflush()` in the sockets API; and besides that - it feels like I'm breaking the abstraction by fiddling with the internals of the Python library for gpsd.
My guess is that it is a typical use case, so there ought to be a nicer way of accomplishing this.
I count on your help,
Alex