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