code: private void handleIncomingPacket(DatagramPacket packet) {
      SsdpResponse response = new ResponseParser().parse(packet);
      if (response == null) {
        // Unknown to protocol
        return;
      }
      if (response.getType().equals(SsdpResponse.Type.DISCOVERY_RESPONSE)) {
        handleDiscoveryResponse(response);
      } else if (response.getType().equals(SsdpResponse.Type.PRESENCE_ANNOUNCEMENT)) {
        handlePresenceAnnouncement(response);
      }
    }
docs: Thid handler handles incoming SSDP packets.
  
  @param packet the received datagram