Java Reference
In-Depth Information
while (!mEndNow) {
mConnection = null;
try {
mConnection = mServerNotifier.acceptAndOpen(mOpHandler);
} catch (IOException e) {
continue;
}
// System.out.println(" got a connection!");
try {
// Bad bad API design, need to synchronize server thread
synchronized(this) {
this.wait();
}
// System.out.println("svr: before conn close");
mConnection.close();
} catch (Exception ex) {
// Log exception
}
} // of while
try {
mServerNotifier.close();
} catch (Exception ex) {
System.out.println("trying to close session...exception");
ex.printStackTrace();
}
}
private void processRequest(DataInputStream dis) {
String pref = null;
String height = null;
String contact = null;
try {
pref = dis.readUTF();
height = dis.readUTF( );
contact = dis.readUTF();
dis.close();
} catch (IOException e) {
System.out.println("in process request exception");
e.printStackTrace();
}
Search WWH ::




Custom Search