salva has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,

I am working on a new version of my Net::SFTP::Foreign module, an SFTP client that runs on top of the OpenSSH SSH client. In difference to other network clients, instead of talking to a socket, it talks to a pipe connected to a slave ssh process that is connected to the remote server.

To get the maximum throughput on transfers, request commands are not sent after the response to the previous one arrives but queued on an output buffer and sent from inside a select loop as soon as possible while at the same time, responses to old requests are read.

My problem is that now, I am trying to make it work under Windows, but select does not work with pipes there and I couldn't find any other way to do asynchronous bidirectional IO with a slave process.

Well, there are some alternatives but I don't like them for different reasons:

Is there any other solution I can use?

Replies are listed 'Best First'.
Re: Windows, pipes and multiplexing IO
by acid06 (Friar) on Mar 23, 2006 at 17:01 UTC
    You could try using a non-blocking TCP socket (there were some recent threads regarding how to use them under Win32) or you could even resort to UDP sockets.

    I don't know how satisfactory you think these solutions are, but I think that rolling up a socket implementation this way shouldn't be very hard.


    acid06
    perl -e "print pack('h*', 16369646), scalar reverse $="