Ejemplo n.º 1
0
 private void readPing(Handler handler, int flags, int length, int streamId) throws IOException {
   if (length != 8) throw ioException("TYPE_PING length != 8: %s", length);
   if (streamId != 0) throw ioException("TYPE_PING streamId != 0");
   int payload1 = in.readInt();
   int payload2 = in.readInt();
   boolean reply = (flags & FLAG_PONG) != 0;
   handler.ping(reply, payload1, payload2);
 }
Ejemplo n.º 2
0
 private void readPing(Handler handler, int length, byte flags, int streamId)
     throws IOException {
   if (length != 8) throw ioException("TYPE_PING length != 8: %s", length);
   if (streamId != 0) throw ioException("TYPE_PING streamId != 0");
   int payload1 = source.readInt();
   int payload2 = source.readInt();
   boolean ack = (flags & FLAG_ACK) != 0;
   handler.ping(ack, payload1, payload2);
 }