Closed eidetic-av closed 3 years ago
Yeah, on our current use-case it does not make a big difference, but I agree it makes sense and makes to SSP applicable to more use cases. I'll merge it after checking the Windows build situation. Thanks.
To avoid conflicts with Moetsi's current setup, I've added polling as an optional build option, set by the env var SSP_WITH_ZMQ_POLLING.
The README and INSTALL.md will be updated accordingly (mentioned in the ZMQ install step) and linked to this PR.
Not sure if this is in your interest to merge or not, but I noticed that
NetworkReader::HasNextFrame()
has not been implemented in master... it just always returns true.For the client I am building, it was necessary that I implemented this properly because of the blocking nature of
NetworkReader::NextFrame()
. I cannot just call this every frame and have the thread block, so first I checkHasNextFrame()
and only callNextFrame()
if it returns true.I say I'm not sure if my solution is in your interest to merge because it uses the draft API of zeromq. That being said, this particular polling API I am using has not changed in years....
Both zeromq and cppzmq need to be built with the draft api flags to enable this.
My solution is to just create a
zmq::poller
which simply checks if a frame has arrived. The polling timeout before the function returns false is set withPOLL_TIMEOUT_MS
.