I'm working on an app that will take data from a cnc machine using a type of query over a TCP socket. For example if I send "?Q100" over the socket the machine would respond with "
SERIAL NUMBER, 1234567"
My issue is that the Socket class uses a callback when it receives data. I need to be able to send a command, wait for a response, then return that value. The timing is important because if i send several commands the order in which they are received matters because there is no identifier for the returned data.
I was looking at the RawSocketSyncronous but i'm not sure how to implement a readLine method for that since it just has a read method for getting bytes from the socket.
Any advice would be appreciated!