miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Use Poll or select for linux

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Bugs
View previous topic :: View next topic  
Author Message
kwlee



Joined: 23 Nov 2007
Posts: 5

PostPosted: Fri Nov 23, 2007 8:21 am    Post subject: Use Poll or select for linux Reply with quote

Hi,

well, it should not be a bug. In miniupnpc.c, the ReceiveData function, and in Linux environment, why can't use "select" waiting data ?

I tried change poll(this one is OK) to select in Linux, but always
timeout... any trick ?

Best Regards,
KWLEE
Back to top
View user's profile Send private message
kwlee



Joined: 23 Nov 2007
Posts: 5

PostPosted: Fri Nov 23, 2007 8:54 am    Post subject: Reply with quote

OK, I got the clue...
the first parameter in select should change from 0 to max_fd + 1
then it should be OK on linux.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1525

PostPosted: Sun Nov 25, 2007 1:19 pm    Post subject: Reply with quote

indeed, the select call should be
n = select(FD_SETSIZE, &socketSet, 0, 0, &timeout);
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.