The previous code would clear DMA buffers when a new TCP
data connection is established. This is bad, because the
completion of the server side accept() call happens at
some undefined moment after completion of the client side
connect() call. The client may in the mean time enable
data acquisition via the control connection. This will
lead to data loss if the server subsequently clears
DMA buffers while acquisition is already in progress.
This commit makes two changes:
- The server does not clear its DMA buffers when it accepts
a new connection.
- New commands "AIN:CLEAR" and "TT:CLEAR" are added which
explicitly clear DMA buffers and drop the current data
connection, if any.