If not, configure for inter-character timeout. Your applications can use sockets without low-level programming . Extensive examples are provided. OPM or ILE programs can use ROI Sockets. This new function of the operating system uses threads where other programs use jobs.
Threads are faster to execute, by orders of magnitude, and take far less CPU to start and end.
This allows ROI to run two processes to handle the socket traffic. One process handles only incoming packets, and the other process handles only outgoing packets. This means that the program is always ready to send AND receive at the same time. There are no modal considerations. When you want to send data out the socket, you do it.