Examples of SocketIOException


Examples of com.corundumstudio.socketio.handler.SocketIOException

        msg.setNodeId(nodeId);
        log.trace("publish: {} msg: {}", name, msg);
        try {
            pub.publish(name, jsonSupport.writeValueAsString(msg));
        } catch (IOException e) {
            throw new SocketIOException(e);
        }
    }
View Full Code Here

Examples of com.corundumstudio.socketio.handler.SocketIOException

                            args[index] = data.get(i);
                            i++;
                        }
                        method.invoke(object, args);
                    } catch (Exception e) {
                        throw new SocketIOException(e);
                    }
                }
            }, classes.toArray(new Class[classes.size()]));
        } else {
            Class objectType = Void.class;
            if (!dataIndexes.isEmpty()) {
                objectType = method.getParameterTypes()[dataIndexes.iterator().next()];
            }

            namespace.addEventListener(annotation.value(), objectType, new DataListener<Object>() {
                @Override
                public void onData(SocketIOClient client, Object data, AckRequest ackSender) {
                    try {
                        Object[] args = new Object[method.getParameterTypes().length];
                        if (socketIOClientIndex != -1) {
                            args[socketIOClientIndex] = client;
                        }
                        if (ackRequestIndex != -1) {
                            args[ackRequestIndex] = ackSender;
                        }
                        if (!dataIndexes.isEmpty()) {
                            int dataIndex = dataIndexes.iterator().next();
                            args[dataIndex] = data;
                        }
                        method.invoke(object, args);
                    } catch (Exception e) {
                        throw new SocketIOException(e);
                    }
                }
            });
        }
    }
View Full Code Here

Examples of com.corundumstudio.socketio.handler.SocketIOException

        msg.setNodeId(nodeId);
        log.trace("publish: {} msg: {}", name, msg);
        try {
            pub.publish(name, jsonSupport.writeValueAsString(msg));
        } catch (IOException e) {
            throw new SocketIOException(e);
        }
    }
View Full Code Here

Examples of com.corundumstudio.socketio.handler.SocketIOException

            @Override
            public void onConnect(SocketIOClient client) {
                try {
                    method.invoke(object, client);
                } catch (InvocationTargetException e) {
                    throw new SocketIOException(e.getCause());
                } catch (Exception e) {
                    throw new SocketIOException(e);
                }
            }
        });
    }
View Full Code Here

Examples of com.corundumstudio.socketio.handler.SocketIOException

            @Override
            public void onDisconnect(SocketIOClient client) {
                try {
                    method.invoke(object, client);
                } catch (InvocationTargetException e) {
                    throw new SocketIOException(e.getCause());
                } catch (Exception e) {
                    throw new SocketIOException(e);
                }
            }
        });
    }
View Full Code Here

Examples of com.corundumstudio.socketio.handler.SocketIOException

                            args[index] = data.get(i);
                            i++;
                        }
                        method.invoke(object, args);
                    } catch (InvocationTargetException e) {
                        throw new SocketIOException(e.getCause());
                    } catch (Exception e) {
                        throw new SocketIOException(e);
                    }
                }
            }, classes.toArray(new Class[classes.size()]));
        } else {
            Class objectType = Void.class;
            if (!dataIndexes.isEmpty()) {
                objectType = method.getParameterTypes()[dataIndexes.iterator().next()];
            }

            namespace.addEventListener(annotation.value(), objectType, new DataListener<Object>() {
                @Override
                public void onData(SocketIOClient client, Object data, AckRequest ackSender) {
                    try {
                        Object[] args = new Object[method.getParameterTypes().length];
                        if (socketIOClientIndex != -1) {
                            args[socketIOClientIndex] = client;
                        }
                        if (ackRequestIndex != -1) {
                            args[ackRequestIndex] = ackSender;
                        }
                        if (!dataIndexes.isEmpty()) {
                            int dataIndex = dataIndexes.iterator().next();
                            args[dataIndex] = data;
                        }
                        method.invoke(object, args);
                    } catch (InvocationTargetException e) {
                        throw new SocketIOException(e.getCause());
                    } catch (Exception e) {
                        throw new SocketIOException(e);
                    }
                }
            });
        }
    }
View Full Code Here

Examples of com.corundumstudio.socketio.handler.SocketIOException

                    if (dataIndex != -1) {
                        args[dataIndex] = data;
                    }
                    method.invoke(object, args);
                } catch (InvocationTargetException e) {
                    throw new SocketIOException(e.getCause());
                } catch (Exception e) {
                    throw new SocketIOException(e);
                }
            }
        });
    }
View Full Code Here

Examples of com.corundumstudio.socketio.handler.SocketIOException

                    if (dataIndex != -1) {
                        args[dataIndex] = data;
                    }
                    method.invoke(object, args);
                } catch (InvocationTargetException e) {
                    throw new SocketIOException(e.getCause());
                } catch (Exception e) {
                    throw new SocketIOException(e);
                }
            }
        });
    }
View Full Code Here

Examples of com.glines.socketio.common.SocketIOException

                    data.append(msg);
                }
                try {
                    dataHandler.onWriteData(continuation.getServletResponse(), data.toString());
                } catch (IOException e) {
                    throw new SocketIOException(e);
                }
                if (!dataHandler.isConnectionPersistent() && !continuation.isInitial()) {
                    Continuation cont = continuation;
                    continuation = null;
                    cont.complete();
                } else {
                    getSession().startHeartbeatTimer();
                }
            } else {
                String data = frame.encode();
                if (!buffer.putMessage(data, maxIdleTime)) {
                    getSession().onDisconnect(DisconnectReason.TIMEOUT);
                    abort();
                    throw new SocketIOException();
                }
            }
        } else {
            throw new SocketIOClosedException();
        }
View Full Code Here

Examples of com.glines.socketio.common.SocketIOException

                LOGGER.log(Level.FINE, "Session[" + getSession().getSessionId() + "]: sendMessage: [" + frame.getFrameType() + "]: " + frame.getData());
            try {
                outbound.sendMessage(frame.encode());
            } catch (IOException e) {
                outbound.disconnect();
                throw new SocketIOException(e);
            }
        } else {
            throw new SocketIOClosedException();
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.