lsalzman / enet

ENet reliable UDP networking library
MIT License
2.72k stars 670 forks source link

Easy access to current fragment count and total fragment count #234

Open NyakoFox opened 9 months ago

NyakoFox commented 9 months ago

In what I'm writing, I have to send some pretty large packets, which get fragmented. I have a progress bar, and I'd like to update it as fragments are getting received, so it doesn't just look like it stalled when it's receiving fragments. An easy way to access the current fragment count and the total fragment count would be appreciated.

lsalzman commented 9 months ago

Remember there can be multiple incoming large packets that can each be fragmented individually, so there is no easy single statistic that I could put in the peer to monitor this.

The best way to monitor progress is to do your own fragmentation for those cases where the user needs to see some sort of progress score, and keep your own score on them as they come in, because this is usually a very application specific thing to track, like sending large files, downloads, etc