Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

test multiple ports  RSS feed

 
glen croteau
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have a requirement to test x (10) ports for a specific connection.
Is it cheaper to have one thread test all the ports for this connection or to spawn 5 threads and have them each test 2 ports.

Thanks
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "cheaper"? It will probably take longer to develop a solution that spawns several threads - that's a cost, too.
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It will probably be faster to have multiple threads. If you use just one thread then it'll have to wait for the timeout for each port that's unavailable. But as Ulf said, it will be more complex as you'll need to collect the results of the (other) checking threads.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!