I am guessing that sending STX and ETX is part of the protocol for this pro*c thing. This is definately not part of IO::socket. A socket is to be considered a stream of bytes (assuming TCP) and nothing more. My guess is that the STX/ETX are there to allow several files to be sent over a single socket connection. In http/1.0 eg each file is sent in a seperate connection so closing the connection signals EOF.
One thing you might have to worry about is any kind of escaping/stuffing required in case the file happens to contain ETX. | [reply] |
I was able to get this working, so I wanted to explain what I was talking about earlier. Yes, IO::socket works simply by opening and closing connections, and so do the c programs I need the PERL to communicate with. But the difference is the c programs need a flag to tell it when the transactions started and ended, STX and ETX whose unix octals are \002 and \003. I was able to get this working simply by adding two print $server lines with the \002 and \003 before and after the files sent.
By the way pro*c is just a version of c that works with embedded sql. It really has nothing to do with the sockets other than that the author was using a table to store constants in.
| [reply] |
In the past, STX and ETX have been used to indicate the Start and End of TeXt. There was also an associated Start Of Header or SOH. So a normal message might have been
SOH Header goes here STX Text goes here ETX
In my experience with Poll Select transactions on a 3201 line, ETX was also used as an end-of-file marker that was followed by an 8-bit checksum.
"Excellent. Release the hounds." -- Monty Burns.
| [reply] |
I'm puzzled as to why this node has been --'d. As far as I know, the information is accurate. If someone can suggest why it is unpopular, I'd appreciate it.
--t. alex
"Here's the chocolates, and here's the flowers. Now how 'bout it, widder hen, will ya marry me?" --Foghorn Leghorn
| [reply] |