Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to port an application from Windows to Android that uses datagramsockets for communication. (C# to Java)

In the windows world, I created a messagereceived event listener that is automatically called when a UDP packet is received. The program continues to process data while it is waiting for a message to arrive.

In Android, there does not appear to be a corresponding event listener. All of the samples that I have found use loops to poll for the data and call the blocking datagramsocket.receive method to fetch the packet.

My program can't sit idle as it waits for the UDP packet, it needs to work even if the other end of the UDP system is down.

Can anyone direct me to a resource that can show me how to replicate this process in java on the Android?

Thanks,
Dan
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900