Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
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
Users Online
CommonCrawl, Google, DotBot, Yandex

Members: 0
Guests: 17
Stats
Files
Topics
Posts
Members
Newest Member
481
3,739
19,386
619
Alexander
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,643
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 >>