Examples of Packet


Examples of be.demmel.jgws.packets.Packet

  }
 
  @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
    MDC.put("channel", ctx.channel().id().asLongText());
    Packet packet = (Packet) msg;
    LOGGER.debug("Choosing handler for packet {}", packet);
    PacketHandler<Packet, TServerData> packetHandler = this.packetHandlers.get(packet.getClass());
   
    List<QueueAction> actions = new ArrayList<>();
   
    if(packetHandler != null) {
      TServerData serverData = ctx.channel().attr(this.dataKey).get();
View Full Code Here

Examples of ca.vanzeben.game.net.packets.Packet

    }

    private void parsePacket(byte[] data, InetAddress address, int port) {
        String message = new String(data).trim();
        PacketTypes type = Packet.lookupPacket(message.substring(0, 2));
        Packet packet = null;
        switch (type) {
        default:
        case INVALID:
            break;
        case LOGIN:
View Full Code Here

Examples of ch.softappeal.yass.core.remote.session.Packet

    writerQueue.put(buffer);
  }

  private void read(final Session session, final Reader reader) {
    while (true) {
      final Packet packet;
      try {
        packet = (Packet)packetSerializer.read(reader);
      } catch (final Exception e) {
        close(session, e);
        return;
      }
      received(session, packet);
      if (packet.isEnd()) {
        return;
      }
    }
  }
View Full Code Here

Examples of com.akdeniz.googleplaycrawler.gsf.packets.Packet

    @Override
    public void encode(IoSession session, Object message, ProtocolEncoderOutput out) throws Exception {

  if (message instanceof Packet) {
      Packet packet = (Packet) message;
      out.write(IoBuffer.wrap(packet.getBytes()));
  } else {
      out.write(message);
  }
    }
View Full Code Here

Examples of com.alibaba.otter.canal.protocol.CanalPacket.Packet

    private InetSocketAddress doConnect() throws CanalClientException {
        try {
            channel = SocketChannel.open();
            channel.socket().setSoTimeout(soTimeout);
            channel.connect(address);
            Packet p = Packet.parseFrom(readNextPacket(channel));
            if (p.getVersion() != 1) {
                throw new CanalClientException("unsupported version at this client.");
            }

            if (p.getType() != PacketType.HANDSHAKE) {
                throw new CanalClientException("expect handshake but found other type.");
            }
            //
            Handshake handshake = Handshake.parseFrom(p.getBody());
            supportedCompressions.addAll(handshake.getSupportedCompressionsList());
            //
            ClientAuth ca = ClientAuth.newBuilder().setUsername(username != null ? username : "").setNetReadTimeout(soTimeout).setNetWriteTimeout(soTimeout).build();
            writeWithHeader(channel,
                            Packet.newBuilder().setType(PacketType.CLIENTAUTHENTICATION).setBody(ca.toByteString()).build().toByteArray());
            //
            Packet ack = Packet.parseFrom(readNextPacket(channel));
            if (ack.getType() != PacketType.ACK) {
                throw new CanalClientException("unexpected packet type when ack is expected");
            }

            Ack ackBody = Ack.parseFrom(ack.getBody());
            if (ackBody.getErrorCode() > 0) {
                throw new CanalClientException("something goes wrong when doing authentication: "
                                               + ackBody.getErrorMessage());
            }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.cluster.Packet

            totalPacketsResent += s.size();
           
            Iterator<Long> it = s.iterator();
            while (it.hasNext()) {
                Long resendPacketId = it.next();
                Packet packet = outgoingPacketsCache.getPacket(resendPacketId);
                if (packet == null){
                    String msg = "Cluster unable to resend packet["+resendPacketId+"] as it is no longer in the outgoingPacketsCache";
                    logger.error(msg);
                } else {
                    int resendCount = packet.incrementResendCount();
                    if (resendCount <= maxResendOutgoing) {
                        resendPacket(packet);
                    } else {                       
                        String msg = "Cluster maxResendOutgoing ["+maxResendOutgoing+"] hit for packet "+resendPacketId
                            +". We will not try to send it anymore, removing it from the outgoingPacketsCache.";
View Full Code Here

Examples of com.calclab.emite.core.client.packet.Packet

    public BasicStanza(final IPacket stanza) {
  super(stanza);
    }

    public BasicStanza(final String name, final String xmlns) {
  super(new Packet(name, xmlns));
    }
View Full Code Here

Examples of com.caucho.bam.packet.Packet

      // remove item from queue
      if (_head.compareAndSet(head, next)) {
        _size.decrementAndGet();

        Packet packet = next.getPacket();
        next.clearPacket();

        // wake any blocked threads
        if (_blockCount.get() > 0 && _size.get() < _blockMaxSize) {
          synchronized (_blockLock) {
View Full Code Here

Examples of com.caucho.bam.packet.Packet

  public long runTask()
  {
    _isRunning = true;

    try {
      Packet packet;
   
      while ((packet = _queue.dequeue()) != null) {
        if (log.isLoggable(Level.FINEST))
          log.finest(this + " dequeue " + packet);
View Full Code Here

Examples of com.caucho.bam.packet.Packet

    return true;
  }
 
  private void deliverStartupPackets()
  {
    Packet packet;
   
    while ((packet = extractStartupPacket()) != null) {
      Mailbox mailbox = getMailbox(packet.getTo());
     
      if (mailbox != null)
        packet.dispatch(mailbox, this);
      else {
        log.warning(this + " failed to find mailbox " + packet.getTo()
                    + " for " + packet);
      }
    }
  }
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.