Examples of DISCONNECT


Examples of de.innovationgate.utils.remote.commands.Disconnect

                            Throwable cause = e.getCause();
                            if (cause instanceof SocketTimeoutException) {
                                // client connection timed out
                                _log.warn("Connection for client '" + _client.getInetAddress() + "' timed out. Sending disconnect command.");
                                // send disconnect command to client
                                command = new Disconnect();
                            } else {
                                _log.error("Unable to retrieve command from client '" + _client.getInetAddress() + "'.", e);
                                _failures++;
                            }
                        } else {
View Full Code Here

Examples of de.innovationgate.utils.remote.commands.Disconnect

     * @throws RemoteException
     * @throws CommandException
     */
    public void disconnect() throws RemoteException, CommandException {
        try {
            Disconnect disconnect = new Disconnect();
            sendCommand(disconnect);
            if (disconnect.disconnected()) {
                _server.close();
            } else {
                throw new RemoteException("Unable to disconnect from server.");
            }
        } catch (RemoteException e) {
View Full Code Here

Examples of me.taylorkelly.bigbrother.datablock.Disconnect

        //plugin.processPsuedotick();
        final Player player = event.getPlayer();
        BBPlayerInfo pi = BBUsersTable.getInstance().getUserByName(player.getName());
        plugin.closeChestIfOpen(pi);
        if (BBSettings.disconnect && pi.getWatched()) {
            Disconnect dataBlock = new Disconnect(player.getName(), player.getLocation(), player.getWorld().getName());
            dataBlock.send();
        }
    }
View Full Code Here

Examples of net.tacospice.stevenet.NetworkMessages.Disconnect

          // Already registered?
          if (connection.name != null)
          {
            logMessage("Discarded login from " + c.getID() + " (already logged in as " + connection.name + ")");

            Disconnect dc = new Disconnect();
            dc.reason = Reason.AlreadyLoggedIn;
            sendToTCP(connection.getID(), dc);

            connection.close();

            return;
          }

          // Invalid name?
          String name = ((Login) object).name;

          if (name == null)
          {
            logMessage("Discarded login from " + c.getRemoteAddressTCP() + " (name missing)");

            Disconnect dc = new Disconnect();
            dc.reason = Reason.NoName;
            sendToTCP(connection.getID(), dc);

            connection.close();

            return;
          }

          name = name.trim();
          if (name.length() == 0)
          {
            logMessage("Discarded login from " + c.getRemoteAddressTCP() + " (name has zero length)");

            Disconnect dc = new Disconnect();
            dc.reason = Reason.ZeroNameLength;
            sendToTCP(connection.getID(), dc);

            connection.close();

            return;
          }

          // Store the name on the connection
          connection.name = name;

          // TODO: verify connection with ServerEventHandler
          clientConnected(connection);

          // Replicate existing nodes
          replicateAllNodes(connection.getID());

          // Notify users
          UserConnect uc = new UserConnect();
          uc.name = connection.name;
          sendToAllTCP(uc);

          logMessage("Accepted login from " + c.getRemoteAddressTCP() + ": " + name);

          return;
        }

        // Ignore any other messages by unregistered users
        if (connection.name == null)
        {
          // TODO: disconnect user?
          logMessage("Disconnected " + c.getRemoteAddressTCP() + " (not registered)");

          Disconnect dc = new Disconnect();
          dc.reason = Reason.DidNotRegister;
          sendToTCP(connection.getID(), dc);

          connection.close();
          return;
View Full Code Here

Examples of org.fusesource.mqtt.codec.DISCONNECT

        };
       
        // Pop the frame into a request so it we get notified
        // of any failures so we continue to stop the transport.
        if(transport!=null) {
            MQTTFrame frame = new DISCONNECT().encode();
            send(new Request(getNextMessageId(), frame, cb));
        } else {
            cb.onSuccess(null);
        }
    }
View Full Code Here

Examples of org.fusesource.mqtt.codec.DISCONNECT

    }

    @Override
    public void onClose(int closeCode, String message) {
        try {
            protocolConverter.onMQTTCommand(new DISCONNECT().encode());
        } catch (Exception e) {
            LOG.warn("Failed to close WebSocket", e);
        }
    }
View Full Code Here

Examples of org.fusesource.mqtt.codec.DISCONNECT

        try {
            switch (frame.messageType()) {
                case PINGREQ.TYPE: return new PINGREQ().decode(frame).toString();
                case PINGRESP.TYPE: return new PINGRESP().decode(frame).toString();
                case CONNECT.TYPE: return new CONNECT().decode(frame).toString();
                case DISCONNECT.TYPE: return new DISCONNECT().decode(frame).toString();
                case SUBSCRIBE.TYPE: return new SUBSCRIBE().decode(frame).toString();
                case UNSUBSCRIBE.TYPE: return new UNSUBSCRIBE().decode(frame).toString();
                case PUBLISH.TYPE: return new PUBLISH().decode(frame).toString();
                case PUBACK.TYPE: return new PUBACK().decode(frame).toString();
                case PUBREC.TYPE: return new PUBREC().decode(frame).toString();
View Full Code Here

Examples of org.fusesource.mqtt.codec.DISCONNECT

    }

    @Override
    public void onClose(int closeCode, String message) {
        try {
            getProtocolConverter().onMQTTCommand(new DISCONNECT().encode());
        } catch (Exception e) {
            LOG.warn("Failed to close WebSocket", e);
        }
    }
View Full Code Here

Examples of org.nfctools.llcp.pdu.Disconnect

    assertEquals("Hello", new String(information.getServiceDataUnit()));
    processPdu = new ReceiveReady(information.getSourceServiceAccessPoint(),
        information.getDestinationServiceAccessPoint(), 1).processPdu(connectionManager);
    assertTrue(processPdu.toString(), processPdu instanceof Disconnect);

    Disconnect disconnect = (Disconnect)processPdu;
    processPdu = new DisconnectedMode(disconnect.getSourceServiceAccessPoint(),
        disconnect.getDestinationServiceAccessPoint(), 0).processPdu(connectionManager);

    assertEquals(0, connectionManager.getOpenConnectionsSize());
    assertFalse(serviceAccessPoint.isConnected());
    assertSymmetryState();
  }
View Full Code Here

Examples of org.nfctools.llcp.pdu.Disconnect

    assertTrue(processPdu.toString(), processPdu instanceof ReceiveReady);
    ReceiveReady receiveReady = (ReceiveReady)processPdu;
    assertEquals(1, receiveReady.getReceived());
    assertEquals(0, receiveReady.getSend());

    processPdu = new Disconnect(32, 32).processPdu(connectionManager);
    assertTrue(processPdu.toString(), processPdu instanceof DisconnectedMode);

    assertEquals(0, connectionManager.getOpenConnectionsSize());
    assertFalse(serviceAccessPoint.isConnected());
    assertEquals("Hello", serviceAccessPoint.getMessageReceived());
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.