Add NetworkError() function
Posted: Tue Feb 18, 2025 12:16 am
Currently, when checking the return value of ReceiveNetworkData() and similar, we get -1 if no more data can be read. However, this could be for any number of reasons, from that being all the data there is to a wouldblock. It's currently impossible to determine this with the Network library. mk-soft wrote the amazing NetworkTCP module, and it gives you different statuses when you receive data. My proposal for the PB stdlib, to avoid breaking old code, is a NetworkError() function, that could return e.g. #PB_Network_EndOfData, #PB_Network_WouldBlock, etc.