clean up better on QUIT
git-svn-id: svn://anubis/gvsu@47 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
a896509598
commit
438f7aee8f
@ -108,7 +108,8 @@ public class KaZaServer implements Runnable
|
||||
m_socket.getOutputStream());
|
||||
|
||||
/* loop processing client messages */
|
||||
for (;;)
|
||||
boolean running = true;
|
||||
while (running)
|
||||
{
|
||||
String inLine = br.readLine();
|
||||
|
||||
@ -172,17 +173,21 @@ public class KaZaServer implements Runnable
|
||||
else if (opCode.equals("QUIT"))
|
||||
{
|
||||
/* user is requesting to leave the system */
|
||||
synchronized (m_clientData)
|
||||
{
|
||||
m_clientData.remove(m_clientIP);
|
||||
br.close();
|
||||
os.close();
|
||||
m_socket.close();
|
||||
return;
|
||||
running = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) { }
|
||||
catch (Exception e) { }
|
||||
finally
|
||||
{
|
||||
synchronized (m_clientData)
|
||||
{
|
||||
m_clientData.remove(m_clientIP);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user