1998Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine -->
<!--X-From-R13: byvireNwbjrgg.znanjngh.cynarg.pb.am -->
<!--X-Date: Fri, 17 Jul 1998 23:27:58 &#45;0700 -->
<!--X-Message-Id: Pine.LNX.3.96.980718181205.430I&#45;100000#andridys,ip.local -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 199807180516.WAA01095#hawk,prod.itd.earthlink.net -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Eng</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:oliver#jowett,manawatu.planet.co.nz">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00248.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00250.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00248.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00269.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00249">Author</A>
&nbsp;|&nbsp;<A HREF="#00249">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00249">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: "<A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A>" &lt;<A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A>&gt;</LI>
<LI><em>Subject</em>: [MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</LI>
<LI><em>From</em>: <A HREF="mailto:oliver#jowett,manawatu.planet.co.nz">oliver#jowett,manawatu.planet.co.nz</A></LI>
<LI><em>Date</em>: Sat, 18 Jul 1998 18:24:00 +1200 (NZST)</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On Sat, 18 Jul 1998, Todd Lair wrote:

&gt; Each player and the master socket, gets its own individual
&gt; event associated with it.  When this type of event ripens,
&gt; it means that this single socket needs polling to see if it
&gt; has input, output, or an exception.  read: not all the
&gt; sockets, but the one.  My question again, is how should I
&gt; go about determining the read, write, exception status. 
&gt; Currently, I'm using select, setting a single bit in each
&gt; of the fd_sets for the descriptor.  This doesn't seem ideal
&gt; to me, since over time, the descriptors get higher in
&gt; number value, and the select call has to scan the fd_sets
&gt; to see where the single bit is set in each of the sets.
&gt; 
&gt; I was wondering if I should just use recv (possibly passing
&gt; the the peek parameter) to determine the status of the
&gt; descriptor that needs to polled.  I was wondering what
&gt; returns I need to worry about, and if this would be a much
&gt; more efficient method opposed to the select call on the
&gt; single descriptor.

I assume that the reason you're checking individual sockets via events is
due to some command-parsing requirement, eg. commands won't be processed
until N seconds in the future after some action by a player.

Why not move this to a separate layer? At the lowest level, select() on
ALL sockets with a timeout equal to the time to next pending event. When
input arrives, read and buffer; when output is possible, write from a
buffer; when exceptions occur, set an appropriate flag. Loop back and
repeat the select. Then when the event actually goes off, you check and
modify the buffers.

Think of it as a wrapper around recv() et al. to avoid making many "real" 
syscalls. The implementation of the wrapper could be different - the same
high-level model could apply to, say, using a pool of threads to handle
I/O, I suspect. 

-O



</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00269" HREF="msg00269.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></strong>
<ul compact><li><em>From:</em> s001gmu#nova,wright.edu</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00248" HREF="msg00248.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></STRONG>
<UL><LI><EM>From:</EM> "Todd Lair" &lt;tlair#mailzone,com&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00248.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00250.html">[MUD-Dev] Design Patterns for Concurrent, Parallel, and Distributed Systems</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00248.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00269.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00249"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00249"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><strong><A NAME="00250" HREF="msg00250.html">[MUD-Dev] Design Patterns for Concurrent, Parallel, and Distributed Systems</A></strong>, 
Alex Oren <a href="mailto:alexo#bigfoot,com">alexo#bigfoot,com</a>, Sun 19 Jul 1998, 08:32 GMT
<LI><strong><A NAME="00246" HREF="msg00246.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 18 Jul 1998, 01:51 GMT
<UL>
<LI><strong><A NAME="00661" HREF="msg00661.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Tue 11 Aug 1998, 17:32 GMT
</LI>
</UL>
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00248" HREF="msg00248.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></strong>, 
Todd Lair <a href="mailto:tlair#mailzone,com">tlair#mailzone,com</a>, Sat 18 Jul 1998, 05:18 GMT
<UL>
<LI><strong><A NAME="00249" HREF="msg00249.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></strong>, 
oliver <a href="mailto:oliver#jowett,manawatu.planet.co.nz">oliver#jowett,manawatu.planet.co.nz</a>, Sat 18 Jul 1998, 06:27 GMT
<UL>
<LI><strong><A NAME="00269" HREF="msg00269.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Mon 20 Jul 1998, 15:57 GMT
<UL>
<LI><strong><A NAME="00273" HREF="msg00273.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></strong>, 
Oliver Jowett <a href="mailto:oliver#jowett,manawatu.planet.co.nz">oliver#jowett,manawatu.planet.co.nz</a>, Mon 20 Jul 1998, 21:51 GMT
<UL>
<LI><strong><A NAME="00277" HREF="msg00277.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></strong>, 
s001gmu <a href="mailto:s001gmu#nova,wright.edu">s001gmu#nova,wright.edu</a>, Tue 21 Jul 1998, 13:49 GMT
<UL>
<LI><strong><A NAME="00300" HREF="msg00300.html">[MUD-Dev] Re: [CODE] [LANGUAGE/PLATFORM SPECIFIC] My Event Engine</A></strong>, 
Joel Kelso <a href="mailto:joel#ee,uwa.edu.au">joel#ee,uwa.edu.au</a>, Wed 22 Jul 1998, 02:21 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>