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());
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user