On 2001-02-28 20:51:18, Andi Gutmans <[EMAIL PROTECTED]> wrote:
> Doing some C OOP here would probably come in handy. Short incomplete example:
> typedef union _io_abstraction {
>          io_base base;
>          socket_abstraction socket;
>          ssl_abstraction ssl;
>          file_abstraction file;
> } io_abstraction;

Thats the idea.  However, doing it exactly this way doesn't lend itself to
having extensions in modules, but that a technicality easily solved by just
passing pointers to io_base's around, rather than declaring the union.

The code might still need to check the type of the underlying io, so we
should probably put an id field into the io base and define bit fields
to indicate if it can have socket operations performed on it, or if it
can be fseek'd for example.  Either that or define those operations as
methods in the io_base.  It feels like we are implementing a VFS layer
in user space ;-)

> I wrote this very quickly so I'm not quite sure I got it all right but it 
> could be the general direction. Don't bash me but MS does some nice stuff 
> this way too :)

I believe you - although it is rare to see some "nice" MS code !
> > > I'm going to look into it in more depth and come back with more info
> > > about where we are using this stuff and where we check for sockets,
> > > and think some more about the open/connect/construct part of it.

I'm really going to do this now.


PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to