Package com.sun.jdi.connect.spi

Examples of com.sun.jdi.connect.spi.ClosedConnectionException


      byte[] handshakeInput = new byte[handshakeBytes.length];
      in.readFully(handshakeInput);
      if (!Arrays.equals(handshakeInput, handshakeBytes))
        throw new IOException("Received invalid handshake"); //$NON-NLS-1$
    } catch (EOFException e) {
      throw new ClosedConnectionException();
    }
  }
View Full Code Here


  @Override
  public byte[] readPacket() throws IOException {
    DataInputStream stream;
    synchronized (this) {
      if (!isOpen()) {
        throw new ClosedConnectionException();
      }
      stream = new DataInputStream(fTransport.getInputStream());
    }
    synchronized (stream) {
      int packetLength = 0;
      try {
        packetLength = stream.readInt();
      } catch (IOException e) {
        throw new ClosedConnectionException();
      }

      if (packetLength < 11) {
        throw new IOException("JDWP Packet under 11 bytes"); //$NON-NLS-1$
      }
View Full Code Here

   * @see com.sun.jdi.connect.spi.Connection#writePacket(byte[])
   */
  @Override
  public void writePacket(byte[] packet) throws IOException {
    if (!isOpen()) {
      throw new ClosedConnectionException();
    }
    if (packet == null) {
      throw new IllegalArgumentException(
          "Invalid JDWP Packet, packet cannot be null"); //$NON-NLS-1$
    }
    if (packet.length < 11) {
      throw new IllegalArgumentException(
          "Invalid JDWP Packet, must be at least 11 bytes. PacketSize:" + packet.length); //$NON-NLS-1$
    }

    int packetSize = getPacketLength(packet);
    if (packetSize < 11) {
      throw new IllegalArgumentException(
          "Invalid JDWP Packet, must be at least 11 bytes. PacketSize:" + packetSize); //$NON-NLS-1$
    }

    if (packetSize > packet.length) {
      throw new IllegalArgumentException(
          "Invalid JDWP packet: Specified length is greater than actual length"); //$NON-NLS-1$
    }

    OutputStream stream = null;
    synchronized (this) {
      if (!isOpen()) {
        throw new ClosedConnectionException();
      }
      stream = fTransport.getOutputStream();
    }

    synchronized (stream) {
View Full Code Here

TOP

Related Classes of com.sun.jdi.connect.spi.ClosedConnectionException

Copyright © 2018 www.massapicom. 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.