U mean to say u wanna accept only one connection ?? then
client = null
while(true){
client = server.accept() ;
if (client != null){
// start thread and break this loop
}
}...