outdoor users(20)

This commit is contained in:
Louis Farina 2021-02-15 17:17:48 +01:00
parent 03d3c77895
commit 18321eb1ef

View file

@ -37,12 +37,13 @@ class ReceiveThread extends Thread {
} }
public void run() public void run()
{ {
ObjectInputStream in;
boolean exit = false; boolean exit = false;
while(!exit) while(!exit)
{ {
try try
{ {
ObjectInputStream in = new ObjectInputStream(socket.getInputStream()); in = new ObjectInputStream(socket.getInputStream());
Notification notif = (Notification) in.readObject(); Notification notif = (Notification) in.readObject();
if(!(notif.getAuthor().equals(user)) && !(notif.getAuthor().isOutdoor() && !isOutdoor)) if(!(notif.getAuthor().equals(user)) && !(notif.getAuthor().isOutdoor() && !isOutdoor))
@ -140,6 +141,7 @@ class ReceiveThread extends Thread {
} }
catch(Exception e) catch(Exception e)
{ {
in.reset();
e.printStackTrace(); e.printStackTrace();
/*System.out.println("Socket closed"); /*System.out.println("Socket closed");
dest_sockets.remove(socket); dest_sockets.remove(socket);