A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/306212.html below:

threads/sockets quick question.

threads/sockets quick question.Ed Hotchkiss edhotchkiss at gmail.com
Mon Sep 19 12:45:32 EDT 2005
Let's say that I avoid the complexities of using classes, and that I avoid 
using anything to count the threads...
 import socket
import threading

def scan(ip, port):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((ip, port))
s.close()
print '%s | %d OPEN \nscanned: %d' % (ip, port, port)
except:
print '%s | %d CLOSED \nscanned: %d' % (ip, port, port)
ip = 'localhost'
for port in range(1, 1024):
thread.start_new_thread(scan, (ip, port,))
  Why does this produce the errr - can't start new thread? I just scrapped 
the rest of the code before, followed peoples ideas, and removed the 
complexities, I can learn the rest later I guess...
thanks again.
 -edward
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20050919/94ee8d79/attachment.html>
More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4