Commit Graph

6 Commits

Author SHA1 Message Date
Michael Davidsaver ea507d46a6 make OperationBase::channelName constant 2025-10-01 15:09:49 -07:00
Michael Davidsaver 20e0fa8ca5 client: re-define the meaning of poke() 2023-04-17 15:54:29 -05:00
Thomas Ives 7ae659678f fix: do not re-search for other channels when doing initial channel search
When creating a large number of Channels at once, we can end up calling
`ContextImpl::poke(true)` many times in quick succession.  This results
in a flood of UDP broadcasts where we are searching for channels that we
only just sent out the initial search request for.

This can easily lead to packets getting lost and us not receiving a
reply for some Channels.  Moreover, as we keep resending search requests
for Channels, we reschedule them further and further in the future (as
`nSearch` is increased).  After the dust settles and we stop poking,
this can result in a wait of several seconds before a Channel which we
have not found is searched for again.

In this commit we avoid this issue by using a separate bucket to hold
channels waiting for their initial search request.  Rather than poking
`tickSearch` to do the initial search and also resend requests for
outstanding channels, we schedule a call to new call `tickSearch` which
will only send the initial search requests.  As such, we will avoid
rebroadcasting search requests for channels we have only just searched
for.

We have prompted the `discover` bool to an enum to distinguish between
the now three different situations `tickSearch` can be called in.
2023-04-14 10:14:30 -07:00
Michael Davidsaver 0de17036f4 add Context::close() 2022-11-27 08:20:13 -08:00
Michael Davidsaver 0ad81d0f49 add Discovered::peerVersion 2022-05-18 12:27:33 -07:00
Michael Davidsaver 7a65a85c99 client: add discover() and pvxlist 2022-04-05 07:57:16 -07:00