Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a catch for the socketExceptions we see on Infinite Loop Of Errors #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions common/src/main/java/org/jspace/gate/KeepClientHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.Socket;
import java.net.SocketException;

import org.jspace.io.jSpaceMarshaller;
import org.jspace.protocol.ClientMessage;
Expand Down Expand Up @@ -59,7 +60,12 @@ public KeepClientHandler(jSpaceMarshaller marshaller, Socket client) throws IOEx
*/
@Override
public ClientMessage receive() throws IOException {
ClientMessage message = marshaller.read(ClientMessage.class, reader);
ClientMessage message = null;
try {
message = marshaller.read(ClientMessage.class, reader);
} catch (SocketException e) {
// It's okay, just below we will set isActive to false, since the message is null
}
isActive = (message != null);
return message;
}
Expand Down Expand Up @@ -96,5 +102,7 @@ public boolean isClosed() {
return isClosed;
}


}