Link to home
Start Free TrialLog in
Avatar of spunog
spunog

asked on

multi sockets on one port

every time I assign more than one socket on a single port the code compiles ok but it throws bind exceptions when I run the server.How can I overcome this ???
Avatar of mrquija
mrquija

is it even possible to assign more than one socket to a single port? I thought each port could only handle one socket?
spunog, you can not listen more than once on a port. Why do you need to listen more than once? Can you paste a piece of you code here?
ASKER CERTIFIED SOLUTION
Avatar of newcumdb
newcumdb

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of spunog

ASKER

newcumdb,
So I just put this line in once ,
ServerSocket socket = new ServerSocket(6666, 300);
and have as many of these as I see fit for example
Socket s = socket.accept();    
Socket s1 = socket.accept();    
Socket s2 = socket.accept();    

???????????????
Avatar of spunog

ASKER

Fair play newcumbd,
that has worked fine
Thanks