3 Replies - 3367 Views - Last Post: 19 February 2013 - 11:02 PM Rate Topic: -----

#1 navogate  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 18-February 13

listening to multiple ports in java?

Posted 18 February 2013 - 12:13 AM

i want to listen multiple ports using java and monitor it,so for this purpose i am in need of a java API which could help me. what i tried is that create a serversocket instance but it listens to only one port.!
Is This A Good Question/Topic? 0
  • +

Replies To: listening to multiple ports in java?

#2 Lemur  Icon User is offline

  • Pragmatism over Dogma
  • member icon


Reputation: 1383
  • View blog
  • Posts: 3,514
  • Joined: 28-November 09

Re: listening to multiple ports in java?

Posted 19 February 2013 - 07:12 PM

Moving to Java
Was This Post Helpful? 0
  • +
  • -

#3 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8346
  • View blog
  • Posts: 31,904
  • Joined: 06-March 08

Re: listening to multiple ports in java?

Posted 19 February 2013 - 09:35 PM

View Postnavogate, on 18 February 2013 - 02:13 AM, said:

what i tried is that create a serversocket instance but it listens to only one port.!

so create an instance for each port you need to monitor
just pass the port number as parameter
Was This Post Helpful? 0
  • +
  • -

#4 Ghlavac  Icon User is offline

  • D.I.C Addict

Reputation: 84
  • View blog
  • Posts: 519
  • Joined: 14-January 09

Re: listening to multiple ports in java?

Posted 19 February 2013 - 11:02 PM

PBL's right, you can create them all in the same place but you're gonna need to spawn new threads to do the serverSocket.accept()
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1