I am trying to implement the scrape method for an UDP tracker but I keep getting 0 seeders/leechers as response. I am still getting a 2 as the action so no error is reported. I have hardcoded a hash here just to show that it has no effect on the result I am getting.
final ByteArrayOutputStream byteStream =new ByteArrayOutputStream();
final DataOutputStream dataStream =new DataOutputStream(byteStream);
dataStream.writeInt(connectResponse.get("connectionId0"));
dataStream.writeInt(connectResponse.get("connectionId1"));
dataStream.writeInt(2);
dataStream.write(connectResponse.get("transactionId"));
bencodeWriter.write(byteOut.toString());
dataStream.writeChars("1D19CC96C1A4965D184E4B215942DBC0A09FF8F2");
dataStream.close();
final byte[] scrapeBytes= byteStream.toByteArray();
I tried different trackers but get the same response. What might be the problem?
Edit: Added the hex dump of all the requests and responses: