protected String doInBackground(String... f_url) {
int count;
byte [] ip_bytes = new byte[] {(byte)192,(byte)168,(byte)1,(byte)100};
try {
InetAddress address = InetAddress.getByAddress(ip_bytes );
byte buffer[] = new byte[2000];
DatagramPacket p = new DatagramPacket(buffer, buffer.length, address, port);
try {
DatagramSocket ds = new DatagramSocket(port);
Log.d("..........","Perfect Binding .... Waiting for Data");
ds.receive(p);
publishProgress(""+p);
Thread.sleep(100);
Log.d("","Received :) ");
} catch(Exception e)
{
e.printStackTrace();
}
} catch (UnknownHostException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
................................... これは Async Backgroung Process で UDP パケットを受信するためのコードですが、単一のパケットを取得できません...コードの何が問題になっていますか?? どうすればこの問題を克服できますか?