Package com.google.code.or.net.impl.packet

Examples of com.google.code.or.net.impl.packet.ErrorPacket


    transport.getOutputStream().flush();
   
    //
    final Packet response = transport.getInputStream().readPacket();
    if(response.getPacketBody()[0] == ErrorPacket.PACKET_MARKER) {
      final ErrorPacket error = ErrorPacket.valueOf(response);
      LOGGER.info("login failed, user: {}, error: {}", this.user, error);
      throw new TransportException(error);
    } else if(response.getPacketBody()[0] == OKPacket.PACKET_MARKER) {
      final OKPacket ok = OKPacket.valueOf(response);
      LOGGER.info("login successfully, user: {}, detail: {}", this.user, ok);
View Full Code Here


       
        //
        final int packetMarker = is.readInt(1);
        if(packetMarker != OKPacket.PACKET_MARKER) { // 0x00
          if((byte)packetMarker == ErrorPacket.PACKET_MARKER) {
            final ErrorPacket packet = ErrorPacket.valueOf(packetLength, packetSequence, packetMarker, is);
            throw new NestableRuntimeException(packet.toString());
          } else if((byte)packetMarker == EOFPacket.PACKET_MARKER) {
            final EOFPacket packet = EOFPacket.valueOf(packetLength, packetSequence, packetMarker, is);
            throw new NestableRuntimeException(packet.toString());
          } else {
            throw new NestableRuntimeException("assertion failed, invalid packet marker: " + packetMarker);
          }
        }
       
View Full Code Here

    transport.getOutputStream().flush();
   
    //
    final Packet response = transport.getInputStream().readPacket();
    if(response.getPacketBody()[0] == ErrorPacket.PACKET_MARKER) {
      final ErrorPacket error = ErrorPacket.valueOf(response);
      LOGGER.info("login failed, user: {}, error: {}", this.user, error);
      throw new TransportException(error);
    } else if(response.getPacketBody()[0] == OKPacket.PACKET_MARKER) {
      final OKPacket ok = OKPacket.valueOf(response);
      LOGGER.info("login successfully, user: {}, detail: {}", this.user, ok);
View Full Code Here

       
        //
        final int packetMarker = is.readInt(1);
        if(packetMarker != OKPacket.PACKET_MARKER) { // 0x00
          if((byte)packetMarker == ErrorPacket.PACKET_MARKER) {
            final ErrorPacket packet = ErrorPacket.valueOf(packetLength, packetSequence, packetMarker, is);
            throw new RuntimeException(packet.toString());
          } else if((byte)packetMarker == EOFPacket.PACKET_MARKER) {
            final EOFPacket packet = EOFPacket.valueOf(packetLength, packetSequence, packetMarker, is);
            throw new RuntimeException(packet.toString());
          } else {
            throw new RuntimeException("assertion failed, invalid packet marker: " + packetMarker);
          }
        }
       
View Full Code Here

    transport.getOutputStream().flush();
   
    //
    Packet packet = transport.getInputStream().readPacket();
    if(packet.getPacketBody()[0] == ErrorPacket.PACKET_MARKER) {
      final ErrorPacket error = ErrorPacket.valueOf(packet);
      LOGGER.info("{}", error);
      return;
    }
   
    //
View Full Code Here

    this.transport.getOutputStream().flush();
   
    //
    final Packet packet = this.transport.getInputStream().readPacket();
    if(packet.getPacketBody()[0] == ErrorPacket.PACKET_MARKER) {
      final ErrorPacket error = ErrorPacket.valueOf(packet);
      throw new TransportException(error);
    }
  }
View Full Code Here

    }
   
    //
    final Packet packet = this.is.readPacket();
    if(packet.getPacketBody()[0] == ErrorPacket.PACKET_MARKER) {
      final ErrorPacket error = ErrorPacket.valueOf(packet);
      LOGGER.info("failed to connect to host: {}, port: {}, error", new Object[]{host, port, error});
      throw new TransportException(error);
    } else {
      //
      final GreetingPacket greeting = GreetingPacket.valueOf(packet);
View Full Code Here

TOP

Related Classes of com.google.code.or.net.impl.packet.ErrorPacket

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.