Note that there are some explanatory texts on larger screens.

plurals
  1. PODEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol
    primarykey
    data
    text
    <p>I m running server on Linux console which written in C and creating client in android. i have not getting any error on DDMS but following Debug message come </p> <pre><code>11-12 20:38:06.787: DEBUG/SntpClient(60): request time failed: java.net.SocketException: Address family not supported by protocol </code></pre> <p>but message will not go to the server. But if create client in C or java it working fine. any suggestion. </p> <pre><code>public class UDPDemo extends Activity { private EditText mEditText; private Button sendButton; private DatagramSocket client_socket; private static InetAddress IPAddress; private byte[] send_data = new byte[1024]; static{ try { IPAddress = InetAddress.getByName("127.0.0.1"); } catch (UnknownHostException e1) { e1.printStackTrace(); } } /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mEditText = (EditText)findViewById(R.id.EditText01); sendButton = (Button)findViewById(R.id.Button01); sendButton.setOnTouchListener( send); } OnTouchListener send = new OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if( event.getAction() == MotionEvent.ACTION_UP) try { client_socket = new DatagramSocket(); String data = mEditText.getText().toString(); send_data = data.getBytes(); DatagramPacket send_packet = new DatagramPacket(send_data, send_data.length, IPAddress, 5000); client_socket.send(send_packet); mEditText.setText(""); }catch (IOException e) { System.out.println("UDPDemo.enclosing_method() error"+e.getMessage()); e.printStackTrace(); } return true; } }; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload