I am a beginner in programming and not working on communication of two programs via serial port. Let’s say on the left side a program sends one byte data “packet” every seconds to serial port, while on the right side another program “catches” that one byte packet. Sometimes the right side program pauses working for a while and does not read incoming bytes but buffer keeps getting bytes, becoming full. I am thinking of how to organize communication when the right side program wakes up from pause and start receiving bytes again, it not get old bytes from buffer but new ones, current ones. Thank you.
Share
It depends what language you are working in. When I have been doing Socket programming, I have been using asynchronous communication using C# and triggering events when you need to be notified that you have received a packet. There is a great example on MSDN