Hi Alls,
I'm trying to implement a threading functionality for this answer : http://stackoverflow.com/questions/3491727/scanning-a-class-c-network-python/3492399#3492399
So far i have something like this:
...[snip]..
m = re.search("/", str(host))
if m :
net,_,mask = host.partition('/')
mask = int(mask)
net = atod(net)
for host in (dtoa(net+n) for n in range(0, 1<<32-mask)):
try:
mycustomsocket(host)
except:
print host+" is down"
pass
else:
mycustomsocket(host)
What I'm looking for, would be to open 255 thread to scan all hosts parsed with mycustomsocket() at once, for speed issues.
Any help would be greatly appreciated !