Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 parse description bug
Yesterday, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, DotBot

Members: 0
Guests: 8
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SmaugFUSS » accept_new - redundancy?
Forum Rules | Mark all | Recent Posts

accept_new - redundancy?
< Newer Topic :: Older Topic > select probably called too often

Pages:<< prev 1 next >>
Post is unread #1 Jul 26, 2003, 5:44 am
Go to the top of the page
Go to the bottom of the page

Kylotan
Fledgling
GroupMembers
Posts37
JoinedNov 28, 2007

In comm.c, I have code that looks like this:
/* Main loop */
while ( !mud_down )
{
  accept_new( control  );
  accept_new( control2 );
  accept_new( conclient);
  accept_new( conjava  );
...

Basically, that is supposed to poll all the listening ports, I guess. But accept_new adds all the currently connected sockets (ie. players, etc) to the FD_SET before calling select. Does this not mean that the 2nd, 3rd, and 4th calls to accept_new (and hence select) are just gonna be filling the FD_SETs another 3 times with no benefit?

I'm thinking about changing it to call accept_new once, but sending a zero-terminated array of descriptors to poll so it can add them all and process all the listening ports in one select. Does this sound reasonable?
       
Post is unread #2 Jul 26, 2003, 12:00 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

You would be better off just getting rid of those 3 extra ports. Smaug has no viable reason for doing this. That way you'll only have one accept_new call to deal with. I'm sure at one time they must have had a reason for doing this but I can't see why since there's no special case handling anywhere for which port you connected with.
       
Pages:<< prev 1 next >>