Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: File Transfer between c and perl sockets

by Merlin42 (Friar)
on Nov 03, 2001 at 01:18 UTC ( [id://122923]=note: print w/replies, xml ) Need Help??


in reply to File Transfer between c and perl sockets

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.
  • Comment on Re: File Transfer between c and perl sockets

Replies are listed 'Best First'.
Re: Re: File Transfer between c and perl sockets
by wileykt (Acolyte) on Nov 05, 2001 at 20:25 UTC
    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://122923]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-19 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found