I have a problem when I am trying to receive a datagram on localhost.
I have a simple client that just sends datagram:
And I have push registry application that starts when I receive a new udp packet on port 5000:
DatagramConnection dgc = (DatagramConnection) Connector.open("datagram://localhost:5000");
byte payload = "Hello World!".getBytes();
Datagram datagram = dgc.newDatagram(payload, payload.length);
It starts fine whenever I sent datagram from my first application but it always prints "null" instead of "Hello Word!" that I sent.
DatagramConnection dgc = (DatagramConnection) Connector.open(connections);
Datagram datagram = dgc.newDatagram(dconn.getMaximumLength());
Does anyone know what the problem could be?