Possibility of an extra device?

Maarten Bezemer m.m.bezemer at student.utwente.nl
Wed Feb 5 08:20:11 PST 2003


On 5 Feb 2003 "Alex Waugh" <alex at alexwaugh.com> wrote:

> Maarten Bezemer wrote:
> > On 5 Feb 2003 "Nick Burrett" <nick at dsvr.net> wrote:
> > 
> > 
> >>Maarten Bezemer wrote:
> >>
> >>
> >>>Hereby a patch for a user definable device. I think it may be handy for
> >>>some particular situations. At least it gets used by CVS :-)
> >>
> >>So what are the benefits of having a user definable device ? I can't 
> >>think of any applications off the top of my head.
> > 
> > 
> > I use it for CVS to connect a file stream (stdout, stdin) to a
> > socket (via a buffer). So all data send to stdout won't be visible on
> > the screen, but will be sended trough a given socketed with the right
> > protocol.
> > CVS was build this way and I had to continue it.
> 
> How are you making use of the device? Is your program modifying the 
> device structure to point reads/writes to the user device to it's own 
> routines? What interface does CVS use to set things up on unix?

CVS on unix runs a thread with the ssh protocol (or another) running
and opens a pipe to it and send/received all its data trought it.
But running different threads at the same time on the commandline it
quite impossible right now. So a pipe is not a option...
So I had to think of some other possibilities and for sending/receiving
ssh data for the client I managed to create a special buffer and
connect it to the stdin/stdout but for the server side it would be
sufficient because CVS is runned from another program (CVSServer) and
the Socket must be passed on also. So I put the socket number in my new
device and my function used that number to read/send data and passes it
on the the stdout or receives it from the stdin.

Maarten

-- 
Maarten Bezemer

http://home.student.utwente.nl/m.m.bezemer/



More information about the gcc mailing list