Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

made socket service better handle normal errors (user disconnects ear…

…ly etc.) - also added IntelliJ IDEA iml files
  • Loading branch information...
commit def4ba55e2694d35ed53981155c0d5fec7664aa2 1 parent 147c973
@hofmeister authored
View
1  modules/webi-client/webi-client.iml
@@ -11,7 +11,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" name="Maven: vonhof:babelshark:1.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
<orderEntry type="module" module-name="babelshark" />
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.9.5" level="project" />
View
1  modules/webi-db/webi-db.iml
@@ -11,7 +11,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" name="Maven: vonhof:babelshark:1.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
<orderEntry type="module" module-name="webi" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-server:8.1.2.v20120308" level="project" />
View
1  modules/webi-mongo/webi-mongo.iml
@@ -11,7 +11,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" name="Maven: vonhof:babelshark:1.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
<orderEntry type="library" name="Maven: org.mongodb:mongo-java-driver:2.8.0" level="project" />
<orderEntry type="module" module-name="webi-db" />
View
1  modules/webi-php/webi-php.iml
@@ -11,7 +11,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" name="Maven: vonhof:babelshark:1.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
<orderEntry type="module" module-name="webi" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-server:8.1.2.v20120308" level="project" />
View
1  modules/webi-postgres/webi-postgres.iml
@@ -11,7 +11,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" name="Maven: vonhof:babelshark:1.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
<orderEntry type="library" name="Maven: postgresql:postgresql:9.1-901-1.jdbc4" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:3.0.5.RELEASE" level="project" />
View
13 modules/webi-websockets/src/main/java/com/vonhof/webi/websockets/SocketService.java
@@ -10,6 +10,7 @@
import com.vonhof.babelshark.reflect.MethodInfo.Parameter;
import com.vonhof.webi.HttpException;
import java.lang.reflect.InvocationTargetException;
+import java.nio.channels.ClosedChannelException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -18,6 +19,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.inject.Inject;
+
+import org.eclipse.jetty.io.EofException;
import org.eclipse.jetty.websocket.WebSocket;
public class SocketService<T extends SocketService.Client> {
@@ -93,7 +96,17 @@ private boolean send(Client client, Event evt) {
client.connection.sendMessage(output);
return true;
+ } catch (EofException ex) {
+ //Ignore error
+ return false;
+ } catch (ClosedChannelException ex) {
+ //Ignore error
+ return false;
} catch (Exception ex) {
+ if (ex.getMessage() != null && ex.getMessage().contains("Broken pipe")) {
+ //Ignore error - user disconnected quickly.
+ return false;
+ }
Logger.getLogger(SocketService.class.getName()).log(Level.SEVERE, null, ex);
return false;
}
View
1  modules/webi-websockets/webi-websockets.iml
@@ -10,7 +10,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" name="Maven: vonhof:babelshark:1.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
<orderEntry type="module" module-name="webi" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-server:8.1.2.v20120308" level="project" />
View
1  webi.iml
@@ -11,7 +11,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
- <orderEntry type="library" name="Maven: vonhof:babelshark:1.0-SNAPSHOT" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:3.8.1" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty:jetty-server:8.1.2.v20120308" level="project" />
<orderEntry type="library" name="Maven: org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016" level="project" />
Please sign in to comment.
Something went wrong with that request. Please try again.