title: DatagramSocket Receive method doesnt receive any packet in UPnP / DLNA discovery on android TV
body: <pre><code>companion object {
      private const val DISCOVER_TIMEOUT = 1500
      private const val LINE_END = &quot;\r\n&quot;
      private const val DEFAULT_QUERY = &quot;M-SEARCH * HTTP/1.1&quot; + LINE_END +
              &quot;HOST: 239.255.255.250:1900&quot; + LINE_END +
              &quot;MAN: \&quot;ssdp:discover\&quot;&quot; + LINE_END +
              &quot;MX: 1&quot; + LINE_END +  //&quot;ST: urn:schemas-upnp-org:service:AVTransport:1&quot; + LINE_END + // Use for Sonos
              &quot;ST: urn:schemas-upnp-org:device:InternetGatewayDevice:1&quot; + LINE_END + // Use for Routes
              LINE_END
      private const val DEFAULT_ADDRESS = &quot;239.255.255.250&quot;}
  
  
  suspend fun startUPnPDiscovery() {
      withContext(Dispatchers.IO) {
          val wifi =
              context.applicationContext.getSystemService(Context.WIFI_SERVICE) as WifiManager
          if (wifi != null) {
              val lock = wifi.createMulticastLock(&quot;mylock&quot;)
              lock.acquire()
              var socket: DatagramSocket? = null
              try {
                  val group = InetAddress.getByName(&quot;239.255.255.250&quot;)
                  val port = 1900
                  val query = customQuery
                  socket = DatagramSocket(null)
                  socket.reuseAddress = true
                  socket.broadcast = true
                  socket.bind(InetSocketAddress(port))
                  val datagramPacketRequest =
                      DatagramPacket(query.toByteArray(), query.length, group, port)
                  socket.send(datagramPacketRequest)
                  while (true) {
                      val datagramPacket = DatagramPacket(ByteArray(1024), 1024)
                      socket.receive(datagramPacket)
                      val response = String(datagramPacket.data, 0, datagramPacket.length)
                      if (response.substring(0, 12).toUpperCase() == &quot;HTTP/1.1 200&quot;) {
                          val device = UPnPDevice(datagramPacket.address.hostAddress, response)
                          threadCount++
                          getData(device.location, device)
                          break
                      }
                  }
              } catch (e: IOException) {
                  e.printStackTrace()
                  listener?.onError(e)
              } finally {
                  socket?.close()
              }
              lock.release()
          }
      }
  }
  </code></pre>
  <p>Hi I am trying to discover Router using Android TV. The above piece of code is working fine with Android Mobiles and I am able to fetch router details but when run on Android TV I never receive any packet. Thanks in advance</p>