User Name:


Forgot your password?
Vote for Us!
adding a new stat to OSET
Mar 18, 2018, 6:02 pm
By joeyfogas
alias snippet fix-like hack
Mar 17, 2018, 6:14 pm
By Vladaar
help with debug?
Mar 17, 2018, 5:52 pm
By joeyfogas
features of a good MUD
Mar 17, 2018, 1:06 am
By GatewaySysop
All skills to a class?
Mar 15, 2018, 11:43 pm
By joeyfogas
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex

Members: 0
Guests: 7
Newest Member
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

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

Black Hand
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 >>