code: @Override
      protected void onPing(RTMPConnection conn, Channel channel, Header source, Ping ping) {
          log.trace("onPing");
          switch (ping.getEventType()) {
              case Ping.PING_CLIENT:
              case Ping.STREAM_BEGIN:
              case Ping.RECORDED_STREAM:
              case Ping.STREAM_PLAYBUFFER_CLEAR:
                  // the server wants to measure the RTT
                  Ping pong = new Ping();
                  pong.setEventType(Ping.PONG_SERVER);
                  pong.setValue2((int) (System.currentTimeMillis() & 0xffffffff));
                  conn.ping(pong);
                  break;
              case Ping.STREAM_DRY:
                  log.debug("Stream indicates there is no data available");
                  break;
              case Ping.CLIENT_BUFFER:
                  // set the client buffer
                  IClientStream stream = null;
                  // get the stream id
                  Number streamId = ping.getValue2();
                  // get requested buffer size in milliseconds
                  int buffer = ping.getValue3();
                  log.debug("Client sent a buffer size: {} ms for stream id: {}", buffer, streamId);
                  // the client wants to set the buffer time
                  stream = conn.getStreamById(streamId);
                  if (stream != null) {
                      stream.setClientBufferDuration(buffer);
                      log.info("Setting client buffer on stream: {}", buffer);
                  }
                  // catch-all to make sure buffer size is set
                  if (stream == null) {
                      // remember buffer time until stream is created
                      conn.rememberStreamBufferDuration(streamId.intValue(), buffer);
                      log.info("Remembering client buffer on stream: {}", buffer);
                  }
                  break;
              case Ping.PING_SWF_VERIFY:
                  log.debug("SWF verification ping");
                  // TODO get the swf verification bytes from the handshake
                  SWFResponse swfPong = new SWFResponse(new byte[42]);
                  conn.ping(swfPong);
                  break;
              case Ping.BUFFER_EMPTY:
                  log.debug("Buffer empty ping");
  
                  break;
              case Ping.BUFFER_FULL:
                  log.debug("Buffer full ping");
  
                  break;
              default:
                  log.warn("Unhandled ping: {}", ping);
          }
      }
docs: {@inheritDoc}