B
Hi there,
I'm trying to implement a TCP-Modbus Server on a Linux Mashine. I have already implemented the connection... (socket, bind, accept) and it works. But I have problems with flushing the TCP Buffer: e.g. my Slave gets a message (with MBAP-Header):
00 01 00 00 00 06 02 03 00 00 00 01
My Slave is configured as Slave #1. So after receiving
00 01 00 00 00 06 02
it knows that this message isn't important. So it should throw the complete message away. That includes the remaining bytes, too:
03 00 00 00 01
How can I do that? I need a concrete Unix / Linux - Function/Macro/....
I already tried:
tcflush( sfd, TCIOFLUSH );
Unfortunately, that does not work.
Thanks for helping...
I'm trying to implement a TCP-Modbus Server on a Linux Mashine. I have already implemented the connection... (socket, bind, accept) and it works. But I have problems with flushing the TCP Buffer: e.g. my Slave gets a message (with MBAP-Header):
00 01 00 00 00 06 02 03 00 00 00 01
My Slave is configured as Slave #1. So after receiving
00 01 00 00 00 06 02
it knows that this message isn't important. So it should throw the complete message away. That includes the remaining bytes, too:
03 00 00 00 01
How can I do that? I need a concrete Unix / Linux - Function/Macro/....
I already tried:
tcflush( sfd, TCIOFLUSH );
Unfortunately, that does not work.
Thanks for helping...