I have a socket based server which accepts client connections. The problem is server is able to accept only one client connection. I want it to accept multiple clients.
server code:
class Conn extends Thread{
ServerSocket ss;
Socket s;
public void run()
{
status.setText(status.getText()+"connecting");
try{
while(true)
{
ss=new ServerSocket(3000);
s=ss.accept();
Read r=new Read(s);
r.start();
}
}catch(Exception e){}
}
}
In the
Connclass, put something like:Open the server socket, and in a loop, accept all incoming connections and process them starting a new thread.