Merge pull request #29 from informatik-ag-ngl/b/looping_receiver
Prevent Receiver from looping after connection loss
This commit is contained in:
commit
5f1efdae31
@ -1,8 +1,6 @@
|
|||||||
package envoy.client.net;
|
package envoy.client.net;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.*;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.ObjectInputStream;
|
|
||||||
import java.net.SocketException;
|
import java.net.SocketException;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -82,8 +80,9 @@ public class Receiver extends Thread {
|
|||||||
logger.log(Level.WARNING, String.format("The received object has the %s for which no processor is defined.", obj.getClass()));
|
logger.log(Level.WARNING, String.format("The received object has the %s for which no processor is defined.", obj.getClass()));
|
||||||
else processor.accept(obj);
|
else processor.accept(obj);
|
||||||
}
|
}
|
||||||
} catch (final SocketException e) {
|
} catch (final SocketException | EOFException e) {
|
||||||
// Connection probably closed by client.
|
// Connection probably closed by client.
|
||||||
|
logger.log(Level.FINER, "Exiting receiver...");
|
||||||
return;
|
return;
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
logger.log(Level.SEVERE, "Error on receiver thread", e);
|
logger.log(Level.SEVERE, "Error on receiver thread", e);
|
||||||
|
Reference in New Issue
Block a user