Browse Source

outdoor users(20)

Louis Farina 11 months ago
parent
commit
18321eb1ef
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/chat/ReceiveThread.java

+ 3
- 1
src/chat/ReceiveThread.java View File

@@ -37,12 +37,13 @@ class ReceiveThread extends Thread {
37 37
 	}
38 38
 	public void run()
39 39
 	{
40
+		ObjectInputStream in;
40 41
 		boolean exit = false;
41 42
 		while(!exit)
42 43
 		{
43 44
 			try
44 45
 			{
45
-				ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
46
+				in = new ObjectInputStream(socket.getInputStream());
46 47
 		        Notification notif = (Notification) in.readObject();
47 48
 		        
48 49
 		        if(!(notif.getAuthor().equals(user)) && !(notif.getAuthor().isOutdoor() && !isOutdoor))
@@ -140,6 +141,7 @@ class ReceiveThread extends Thread {
140 141
 			}
141 142
 			catch(Exception e)
142 143
 	    	{
144
+				in.reset();
143 145
 				e.printStackTrace();
144 146
 				/*System.out.println("Socket closed");
145 147
 	        	dest_sockets.remove(socket);

Loading…
Cancel
Save