Output to Socket

D.Cook

Member
I would love to redirect the program output to an open socket object.. has anybody tried this and come up with a clever solution, or have any ideas?

I have a couple hundred old programs that output to file (eq with display statement), but I'd like to output unbuffered directly to a socket (to send the information real-time as it is generated).
My current solution: after the process is finished, simply read the generated file into the socket. But this means potentially waiting a long time before the output is sent to the socket.
 

Marian EDU

Member
Yeah, one would definitively expect to have sockets as an regular input/output stream in a 4GL... while there is more control when using sockets the 3GL way having socket streams added in 4GL would ease some pain but I will not hold my breath on having them added soon :)

About the only solution I can see is to use output through and span a small executable that 'streams' whatever you pipe in from 4GL through a socket connection proven you don't care much about what is returned back... the executable should accept some connection parameters and you can check the return code if there was an error on connecting (plain ansi c will do it I guess unless you can get something like cURL to work for you).
 
Top