🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #942

Re: interviews considered arcane

#942
From: Mark Linton
Date: Mon, 22 Apr 1991 17:31
15 lines
1413 bytes
In article <28102@uflorida.cis.ufl.EDU>, dlw@bale.cis.ufl.edu (Dave Wilson) writes:
|> No, it's not that bad, but I am having trouble with the concepts.  In
|> particular, the main loop.  I have created a meter class, and now I want
|> them to respond both to events and to socket input.  I could send the tray
|> of objects a Handle message (for events), or set up a Dispatcher and send
|> it a dispatch message for file & socket i/o, but how do I do both?  Any
|> pointers would be most appreciated.

You need to register an input handler with the global dispatcher, something like

	Dispatcher::instance().link(fd, Dispatcher::ReadMask, handler)

where handler is an IOHandler.  World uses the IOCallback macro to generate
a "callback" handler--an object consisting of a World* and World::func that
calls world->*func.  The function is called when input is ready on fd.
Technical Details
Message-ID: <1991Apr22.173152.10660@odin.corp.sgi.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!sgi!shinobu!odin!marktwain.rad.sgi.com!linton
References: <28102@uflorida.cis.ufl.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!decwrl!sgi!shinobu!odin!marktwain.rad.sgi.com!linton
From: linton@marktwain.rad.sgi.com (Mark Linton)
Newsgroups: comp.windows.interviews
Subject: Re: interviews considered arcane
Message-ID: <1991Apr22.173152.10660@odin.corp.sgi.com>
Date: 22 Apr 91 17:31:52 GMT
References: <28102@uflorida.cis.ufl.EDU>
Sender: news@odin.corp.sgi.com (Net News)
Reply-To: linton@marktwain.rad.sgi.com (Mark Linton)
Organization: sgi
Lines: 15