Repository navigation
Conversation
The handshake compared a single recv() with the expected reply. TCP may split a reply over several reads, and after "< rawmode >" socketcand can send the first frames in the same segment as "< ok >". Both raised CanError during the bus constructor. Collect data until a whole reply is in the receive buffer, compare only that reply and keep anything after it, so frames that arrived with the reply are returned by recv().
AI ReviewVerdict: Request changes. Compared to Behaviour vs.
|
…cand Raise CanInitializationError instead of blocking when the server sends data that does not start with '<' (e.g. another service on that port).
Summary of Changes
_expect_msg()compared the result of a singlerecv()with the expected reply. TCP is a stream, so a reply can arrive in two reads, and after< rawmode >socketcand can send the first frames in the same segment as< ok >on a busy bus. Both cases raisedCanErrorin the bus constructor._parse_receive_buffer(), unchanged) and returned by the nextrecv().< ok >, replies split over reads, and an error reply still raisingCanError.Related Issues / Pull Requests
Type of Change
Checklist
tox).