This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
    Bookmark Topic Watch Topic
  • New Topic

socket question

 
Steven Alvarez
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Report post to moderator
Ok I found this on the net


I was wondering how can I change this from 1 socket to lets say 20. Do I just do a loop?
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Report post to moderator
Ah, this is clearer than the copy of the question over in the Sockets forum. The sherrifs will probably close this one, but I'll toss something in first.

You have a socket client that issues a GET to a web server somewhere and displays the results. I'd get this code out of main and into an instance method. Then we could do something like:

You could do that in a loop neatly enough. Once that's working for you, we can talk about threads and doing several at once.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65225
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place.
 
    Bookmark Topic Watch Topic
  • New Topic