simultaneous read/write to tcp/ip socket [message #85754] |
Mon, 02 September 2013 17:25  |
suicidaleggroll
Messages: 14 Registered: September 2013
|
Junior Member |
|
|
I have a device I'm attempting to interface with via TCP/IP. I've already implemented the read side of the problem, the IDL process is pulling in continuous data, parsing it, logging it, etc. I haven't implemented the write side of the problem, but it shouldn't be an issue. The real problem is I'm not seeing how I'll be able to implement both read and write at the same time.
The writing is user-driven, messages are only sent to the device when the user requests them via command prompt. The reading is device-driven, it's constantly sending data that needs to be read, interpreted, logged, etc in real time. Only one TCP/IP connection to the device is allowed at a time. It should be all command line, no GUI.
I keep thinking of different ways I could implement this, but keep running into walls. Obviously I can do continuous blocking read without issue, and I'm sure I could do continuous write (blocking on user IO) without issue, but how do I implement a code that can receive continuously while simultaneously prompting the user for input and sending when requested? I've considered IDL_IDLBridge, and have used this successfully in the past for other problems, but I'm not presently seeing how this could solve the problem given the constraints of the situation.
Any help would be appreciated.
|
|
|