Reading a TCP socket and scanning a delimiter are two different things.
You can read all the available data in a non-blocking socket into a byte array / string, and then scan the byte array for your separator. Do whatever you need, including possibly saving data after the delimiter for the next read attempt.
- , .