Closed gerw closed 1 year ago
BTW: I am wondering about the except struct.error as err: In which circumstances can the struct.unpack raise an exception? I think only if it gets not the correct number of bytes. This, in turn, can only happen, if the _socket.recv does not return the correct number of bytes (which is, by documentation, possible). Maybe this should be handled in the new reading routines?
Are you suggesting to add this in this pull request, or will you prepare this later on? Should we create an issue for this?
Deleting more lines that are re-added. I like those refactorings. Makes the code better understandable :-).
This PR tries to remove some duplicated code by introducing low-level helper functions for receiving and sending data.
BTW: I am wondering about the
except struct.error as err
: In which circumstances can thestruct.unpack
raise an exception? I think only if it gets not the correct number of bytes. This, in turn, can only happen, if the_socket.recv
does not return the correct number of bytes (which is, by documentation, possible). Maybe this should be handled in the new reading routines?