Examples of WebSocketException


Examples of org.jwebsocket.kit.WebSocketException

        byte[] data;
        try {
            data = aData.getBytes(aEncoding);
            send(data);
        } catch (UnsupportedEncodingException e) {
            throw new WebSocketException("Encoding exception while sending the data:" + e.getMessage(), e);
        }
    }
View Full Code Here

Examples of org.jwebsocket.kit.WebSocketException

            socket.shutdownInput();
            socket.shutdownOutput();
            socket.close();
            status = WebSocketStatus.CLOSED;
        } catch (IOException ioe) {
            throw new WebSocketException("error while closing websocket connection: ", ioe);
        }
        // TODO: add event
        notifyClosed(null);
    }
View Full Code Here

Examples of org.jwebsocket.kit.WebSocketException

        notifyClosed(null);
    }

    private void sendCloseHandshake() throws WebSocketException {
        if (!connected) {
            throw new WebSocketException("error while sending close handshake: not connected");
        }
        try {
            output.write(0xff00);
            // TODO: check if final CR/LF is required/valid!
            output.write("\r\n".getBytes());
            // TODO: shouldn't we put a flush here?
        } catch (IOException ioe) {
            throw new WebSocketException("error while sending close handshake", ioe);
        }
        connected = false;
    }
View Full Code Here

Examples of org.jwebsocket.kit.WebSocketException

                port = 80;
            }
            try {
                socket = new Socket(host, port);
            } catch (UnknownHostException uhe) {
                throw new WebSocketException("unknown host: " + host, uhe);
            } catch (IOException ioe) {
                throw new WebSocketException("error while creating socket to " + url, ioe);
            }
        } else if (scheme != null && scheme.equals("wss")) {
            if (port == -1) {
                port = 443;
            }
            try {
                SocketFactory factory = SSLSocketFactory.getDefault();
                socket = factory.createSocket(host, port);
            } catch (UnknownHostException uhe) {
                throw new WebSocketException("unknown host: " + host, uhe);
            } catch (IOException ioe) {
                throw new WebSocketException("error while creating secure socket to " + url, ioe);
            }
        } else {
            throw new WebSocketException("unsupported protocol: " + scheme);
        }

        return socket;
    }
View Full Code Here

Examples of org.jwebsocket.kit.WebSocketException

      EngineListener listener = new EngineListener(this);
      mEngineThread = new Thread(listener);
      mEngineThread.start();

    } catch (IOException ex) {
      throw new WebSocketException(ex.getMessage());
    }

    // TODO: results in firing started event twice! make more clean!
    // super.startEngine();
    if (mLog.isInfoEnabled()) {
View Full Code Here

Examples of org.jwebsocket.kit.WebSocketException

   *             if there's an exception while initialization
   */
  public final WebSocketInitializer initialize() throws WebSocketException {
    String lConfigPath = JWebSocketConfig.getConfigurationPath();
    if (lConfigPath == null) {
      throw new WebSocketException(
          "Either JWEBSOCKET_HOME variable is not set"
          + " or jWebSocket.xml file does neither exist at %JWEBSOCKET_HOME%/conf"
          + " nor at %CLASSPATH%/conf.");
    }
    // load the entire settings from the configuration xml file
View Full Code Here

Examples of org.jwebsocket.kit.WebSocketException

      XMLStreamReader lStreamReader = null;
      lStreamReader = lFactory.createXMLStreamReader(lFIS);
      lConfig = mConfigHandler.processConfig(lStreamReader);
    } catch (XMLStreamException ex) {
      lMsg = ex.getClass().getSimpleName() + " occurred while creating XML stream (" + aConfigFilePath + ").";
      throw new WebSocketException(lMsg);
    } catch (FileNotFoundException ex) {
      lMsg = "jWebSocket config file not found while creating XML stream (" + aConfigFilePath + ").";
      throw new WebSocketException(lMsg);
    }
    return lConfig;
  }
View Full Code Here

Examples of org.zaproxy.zap.extension.websocket.WebSocketException

 
  public void selectAndShowItem(WebSocketMessageDTO message) throws WebSocketException {
    Integer modelRowIndex = model.getModelRowIndexOf(message);
   
    if (modelRowIndex == null) {
      throw new WebSocketException("Element not found");
    }

    int viewRowIndex = view.convertRowIndexToView(modelRowIndex);
    view.setRowSelectionInterval(viewRowIndex, viewRowIndex);
   
View Full Code Here

Examples of org.zaproxy.zap.extension.websocket.WebSocketException

          if (!from.equals(to)) {
            wsMessage.setReadablePayload(to);
          }
        } catch (IllegalArgumentException e) {
          // e.g.: Illegal group reference when '$'-sign is used
          throw new WebSocketException("Replacement text of WebSocket payload filter contains non-escaped characters (\\,$).", e);
        } catch (StringIndexOutOfBoundsException e) {
          // e.g.: String index out of range: 1 when '\' is used
          throw new WebSocketException("Replacement text of WebSocket payload filter contains non-escaped characters (\\,$).", e);
        }
      }
    }
  }
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.