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 ..
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.
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.