talostrading / sonic

Sonic is a Go library for network and I/O programming that provides developers with a consistent asynchronous model, with a focus on achieving the lowest possible latency and jitter in Go.
MIT License
676 stars 16 forks source link

Dynamically change a udp multicast peer's read buffer #99

Closed sergiu128 closed 1 year ago

sergiu128 commented 1 year ago

Consider the following scenario: (showcased in the test)

If peer A reads something in b1, peer B must not overwrite what has been read by peer A. Instead, peer B must complete its read into whatever buffer peer A now reads into, say b2. That means peer A must change the buffer peer B reads into in its read callback. To summarize:

More concretely, for edxm historical feed b1, b2 etc are chunks obtained from a bip buffer.