logo       

cvssync, ssh, serve stdio need a missing common infrastructure: msg#00399

Subject: cvssync, ssh, serve stdio need a missing common infrastructure
Hi Nathaniel,
Hi Jon (Bright),

while dusting off the ssh (and serve stdio) branch I realized that all
these works need a common infrastructure: The ability to
(cross-platform!) deal with pipes.

Since serve stdio seemed the least intrusive I looked into separating it
from the rest ... but ...

serve stdio needs a Netxx Stream which uses one fd for reading (0) and
one fd for writing (1). While I know enough of unix architecture to
design such a beast (it is part of the ssh branch) I don't know deeply
enough how Windows handles such things.

I need one Netxx::Stream which handles stdi/o (two file descriptors
accessed via read/select/write on unix) and one Stream which handles a
bidirectional pipe (the same on unix!). Are these tasks on Windows!
similar enough to get covered by one class?

I have a working example of a pipe invocation on Windows (2*CreatePipe +
CreateProcess) but the HANDLE s are accessed via Read/WriteFile and not
via read/write (are write and HANDLEs compatible?).

On the other hand my Pipe class is derived from Netxx::Stream but IIRC
netxx is designed to handle sockets which are totally different on
Windows (I see that get_last_error always uses WSAGetLastError which is
nonsense if you access files). So if my worst fears come true
netxx::Stream is uncapable on handling even the writing/reading half of
neither pipes nor stdio.

<looking into the source> the (undocumented >:-( ) Netxx::Socket uses
recv() and only handles files on unix because of unix' philosophy.

:-(

So it looks like I have to write a Socket replacement, too. So my questions:

Do you see any alternative to this (e.g. using c++ streambufs in netsync
(which is a common interface/superset of netxx::Sockets and files))?
IIRC likely to fail because streambufs have no similar concept to
select()/Netxx::Probe().

Should I hack netsync (I need a pair<int,int> instead of int for
sockets) in a way which disables these features on Windows. (serve stdio
is useless on Windows unless combined with ssh:/file:)

Jon: Do you think that stdio and 2*pipe are similar enough on Windows to
get covered by one single class? Would you suggest to use read() or
ReadFile()?

   Christof

PS: This nicely explains why windows compatibility indead is the
greatest hurdle to merging any of these branches into mainline.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Monotone-devel mailing list
Monotone-devel@xxxxxxxxxx
http://lists.nongnu.org/mailman/listinfo/monotone-devel
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
linux.arklinux....    user-groups.lin...    kde.usability/2...    ietf.ipp/2002-0...    mail.spam.spamc...    os.netbsd.devel...    audio.cd-record...    text.unicode.de...    php.documentati...    games.fps.halfl...    window-managers...    suse.oracle.gen...    bug-tracking.gn...    video.dvdrip.us...    xfree86.cvs/200...    java.netbeans.m...    network.argus/2...    culture.sf.kill...    debian.ports.al...    freebsd.questio...    qplus.devel/200...    handhelds.palm....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe