• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Increasing sockets

 
Steven Alvarez
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How does one increase the amount of sockets used in a socket? For example If I wanted to make the socket by increasing it from using 1 socket to lets say 20 sockets?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show some code where you're using sockets and describe what happens when you don't have enough?
 
Steven Alvarez
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I found out I need something called multithreading. I want to make more then one connection to a https site.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup, threading will let you retrieve from several sites or pages at once. Given my home PC and network and the program I wrote, I find it useful to run maybe four at once, but more than that get in each other's way.

Try the Sun Concurrency Tutorial for a great introduction to threads. You'll want to capture the results from each thread, so you might use join() or a cool new class like Future. Work through the tutorial and see if those words make sense then.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic