This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Async socket limit problem.

Old posts that have not been replied to for several years.
Locked
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Async socket limit problem.

Post by Ofloo »

does anyone know how to limit sockets ?

i am doing a socket check for proxys and i wana be able to limit the threads when i use a async socket cause when join flood appears.. or when netsplits occour mass joins happen .. and the bot goes balistic for opening large amount of sockets so i was wondering if there was a way to limit it.. and cache this .. just wondering for a solution on how you could do this ..
XplaiN but think of me as stupid
e
egghead
Master
Posts: 481
Joined: Mon Oct 29, 2001 8:00 pm
Contact:

Re: Async socket limit problem.

Post by egghead »

Ofloo wrote:does anyone know how to limit sockets ?

i am doing a socket check for proxys and i wana be able to limit the threads when i use a async socket cause when join flood appears.. or when netsplits occour mass joins happen .. and the bot goes balistic for opening large amount of sockets so i was wondering if there was a way to limit it.. and cache this .. just wondering for a solution on how you could do this ..
Upon a join you add the IP to the list of IP's to be checked.

Every x seconds/minutes you check the number of opened sockets. If it is below a treshhold, you add checks on the IPs from the list.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

suggestion of me would be:
add each started query with lappend to a list, delete each timeouted/failed/success with lrepleace. As long the list is under 5 socks, open them imediadly (this will ensure fast remove from channel, while no flood), if there are more bind a time event to each sec to check if 5 less than 5 are open and process the next ones, if wise ^-^ (and this should reduce resource usuage to a apzectable). if the machine is slow or faster you can change the max simul syn sends or increase time between checks.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Locked