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

Re^2: Mixing sysread() with ?

by wanna_code_perl (Pilgrim)
on May 26, 2008 at 23:26 UTC ( #688568=note: print w/replies, xml ) Need Help??


in reply to Re: Mixing sysread() with <FILEHANDLE>?
in thread Mixing sysread() with <FILEHANDLE>?

Truly, I don't want to re-invent FTP. The key here is that the only channel I can rely on is SSH, and it is going to be way too much overhead to open up separate data channels for each binary object.

Objects vary in size from a few bytes to about 1GB, and there could easily be thousands in a single session.

I guess I could open up one extra data channel when the original connection is initiated, and then use syswrite/read on that, approximately like this:

Control channel:

C: STORE Name=<name> Content-Length=<length> MD5=<hash> S: OK, go ahead

Then the client transmits the object in a series of syswrite() calls to the separate SSH. The separate process on the server would do sysread() only.

However, I would prefer to in-line it in one channel, to avoid the complexity of the extra connection and extra processes/threads. HTTP transmits a mixture of text and binary data pretty readily through a single socket.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://688568]
help
Chatterbox?
Corion is mildly surprised as some different toy projects coagulate into a useful application. I've been toying with writing a Meetup wrapper and also have been toying with synchronizing events between (CalDAV) calendars, and now that means I can ...
[Corion]: ... easily* synchronize my personal calendar with Meetup and import stuff from Meetup there
[Corion]: * Code not yet written, some restrictions may apply

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (11)
As of 2017-02-23 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (343 votes). Check out past polls.