Use GPSdEndpoint's retryInterval when retrying connection
Remove magic sleep()'s and join()'s
I've tested and found that these have no effect whatsoever, so I removed them. Also it didn't seem like a good idea to block the calling thread with arbitrary timeouts. Please let me know if I missed their purpose.
Don't create SocketThread as a daemon thread
This change makes using the API cleaner and the library easier to use for developers because they won't need to use sleep() or join() the SocketThread, which in fact is private to the GPSdEndpoint instance and gets reinstantiated upon reconnecting.
The change I'm proposing seems like the cleanest and simplest solution compared to just exposing the SocketThread via a getter as this would impose developers to write much more complex logic to handle concurrency and reconnections.
Also, by not being a daemon, the SocketThread keeps running until GPSdEndpoint::stop() gets called.
Use GPSdEndpoint's retryInterval when retrying connection
Remove magic sleep()'s and join()'s I've tested and found that these have no effect whatsoever, so I removed them. Also it didn't seem like a good idea to block the calling thread with arbitrary timeouts. Please let me know if I missed their purpose.
Don't create SocketThread as a daemon thread This change makes using the API cleaner and the library easier to use for developers because they won't need to use
sleep()
orjoin()
the SocketThread, which in fact is private to the GPSdEndpoint instance and gets reinstantiated upon reconnecting. The change I'm proposing seems like the cleanest and simplest solution compared to just exposing the SocketThread via a getter as this would impose developers to write much more complex logic to handle concurrency and reconnections. Also, by not being a daemon, the SocketThread keeps running untilGPSdEndpoint::stop()
gets called.