implemented QUIT message
git-svn-id: svn://anubis/gvsu@46 45c1a28c-8058-47b2-ae61-ca45b979098e
This commit is contained in:
parent
5c0071a232
commit
a896509598
@ -53,6 +53,19 @@ public class KaZaClient
|
|||||||
|
|
||||||
public boolean connected() { return m_connected; }
|
public boolean connected() { return m_connected; }
|
||||||
|
|
||||||
|
public void close()
|
||||||
|
{
|
||||||
|
if (m_connected)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
m_os.writeBytes("QUIT\n");
|
||||||
|
m_os.close();
|
||||||
|
m_socket.close();
|
||||||
|
} catch (Exception e) { }
|
||||||
|
m_connected = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Vector<SearchResult> performSearch(String query)
|
public Vector<SearchResult> performSearch(String query)
|
||||||
{
|
{
|
||||||
Vector<SearchResult> results = new Vector<SearchResult>();
|
Vector<SearchResult> results = new Vector<SearchResult>();
|
||||||
|
@ -169,6 +169,18 @@ 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) { }
|
} catch (Exception e) { }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user