Link to home
Start Free TrialLog in
Avatar of belim
belim

asked on

Close ServerSocket from listening the port

I am writing chat program in peer to peer basic, which in the program i have serversocket function waiting to connect and also socket function to connect.which means 2 functions in one program.My question is how am i going to stop the listening port from keep on listening,when i intend to make connection, i try to put the serversocket.close method in the button to connect, which means if i intend to make connection, i will stop the port from listening.Please advice.
Avatar of heyhey_
heyhey_

you must create several Threads.
ASKER CERTIFIED SOLUTION
Avatar of shekoff
shekoff

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 belim

ASKER

Thanks!
you deserved for it...