The original code was created for the case, that the whole message will come in one event. In real life (especially by serial communication) the bytes come partially. The changed code process the data like stream and not like single frames. TCP has actually the same problem.
The original code was created for the case, that the whole message will come in one event. In real life (especially by serial communication) the bytes come partially. The changed code process the data like stream and not like single frames. TCP has actually the same problem.