discuss-gnustep
[Top][All Lists]
Advanced

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

NSRunLoop questions


From: Jay McCarthy
Subject: NSRunLoop questions
Date: 16 Dec 2001 19:31:55 -0500

Hello,

This weekend I was looking into what the best way to write an internet
server using GNUstep was. I noted that there was no native support in
GNUstep for socket abstractions or anything of that nature. I also noted
that you could use NSFileHandle as a wrapper around a socket to use it
in a GNUstep application.

That would be great for the client side of something but it doesnt
necessarily work for a server which would need to handle multiple
clients. Then I looked into NSRunLoop and figured that it would be the
best way to do, because it was made to monitor input sources for data.

After looking into this I tried to write an class that I could use, but
I ran into a problem about the proper way a port should respond to an
NSRunLoop. There was no obvious example of something that could be used
in an NSRunLoop either - other than a timer. The problem I hit was that
any time I used -addPort: port toMode: mode I would get the error: 
"Uncaught exception NSInvalidArgumentException, reason: RunLoop listener
has no event handling method"
Which comes from the port object not responding to the "eventSel"
method. A quick grep through the headers and source of Foundation and
AppKit doesnt return any classes that support this method.

My questiones are-
Is NSRunLoop usuable for what I want?
Should I subclass NSPort - or use NSPort - and how would I do such a
thing?
Is there already some sort of Framework written to accomplish this?
How was this done with OPENSTEP - and does anyone know of an application
with an open source I could look at for inspiration and education?

TIA,
Jay

-- 
Jay McCarthy <jay@kenyamountain.com>




reply via email to

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