Hi,

I have an Android App which uses Java NIO to send and receive UDP
packets. When the App sends a UDP packet to the server, it can receive
the response packet back. However, it cannot always receive packets
initiated from the server. The problem occurs only in Android 2.2
(both emulator and device). When I reboot the device, the problem
disappears for a while but then occur again. The code is as follows.

DatagramChannel channel = DatagramChannel.open();
channel.configureBlocking(false);
channel.socket().bind(null);
channel.socket().setReceiveBufferSize(BUF_SIZE);

Selector selector = Selector.open();
channel.register(selector, SelectionKey.OP_READ);

while(true){
  selector.select();
  ... // receive packet
}

Any Help?

Thanks,
Costa

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to