Can someone please help me with the following code? The methods runs until ss.accept(); I run the server.run method drom a mainframe and it looks great up until that line of code. I tried debugging and once i get there it simply stops, no exceptions thrown
public class Server extends Thread{
ServerSocket ss;
private boolean running = true;
private LinkedList<Participant> participants = new LinkedList<Participant>();
final int SERVER_PORT = 4567;
public Server(){
try{
this.ss = new ServerSocket(SERVER_PORT);
}catch(Exception e){
System.out.println("problem at...");
}
}//Constructor
public void run(){
try{
while(running){
System.out.println("35");
Socket sock = this.ss.accept();
System.out.println("39");
Participant part = null;
part = new Participant(this,sock);
participants.add(part);
part.start();
}
}catch(Exception e){
e.printStackTrace();
}
}
}//Server
It’s waiting for a request from a client. Did you send a request from a client and try ?