discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSStream and friends


From: hns
Subject: Re: NSStream and friends
Date: 1 Feb 2006 06:56:31 -0800
User-agent: G2/0.2

Derek Zhou schrieb:

> Hi all,
> Right now gnustep is missing the NS*Stream classes. Has anyone
> been thinking about implementing them? They look useful; provide nicer
> and saner interface to sockets than NSFileHandle.
> If they are not taken, I will try to write them and post here within
> a week or so. It doesn't look like too hard to do.
> Derek

I am currently also working on that in my efforts to make mySTEP more
compatible to the 10.4 documentation of Foundation.framework.

What I noted so far:
* the fundamental class is not NSFileHandle but NSStream (so, basing
NSStream on NSFileHandle is not a good idea)
* NSStream is the only interface to the runloop and its select() call
* implementation needs private classes _NSMemoryInputStream,
_NSMemoryOutputStream, _NSInputSocketStream and _NSOutputSocketStream
(as I call them - they are not documented)
* NSFileHandle can be nicely based on the streams interface (by a
private -_initWithFileDescriptor method in NSStream) and all the
private extensions to install it into runloops can be removed
* doing so has of course influence on other classes which assume these
extensions to be available
* therefore, NSPort (NSConnection) must also be based on NSStream. But
this seems to make everything much simpler and more straightforward
* I don't have analyzed yet if the private NSFileHandle interface is
used elsewhere (NSURLHandle?)

I hope that I have this (together with the recently mentioned
NSPredicate/NSExpression code) ready for publication within 4 weeks,
i.e. FOSDEM. It already compiles without warnings - but I have not yet
implemented everyhing and not tested.

Since I already have a copyright assignment with FSF for GNUstep, it
should not be a problem to migrate that to GNUstep.

Nikolaus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]