Answer the question
In order to leave comments, you need to log in
Falls on bind () in native?
I write the following native code:
sock = socket(AF_INET, SOCK_DGRAM, 0);<br>
if(sock < 0) return false;<br>
<br>
addr.sin_family = AF_INET;<br>
addr.sin_port = htons(UDP_PORT);<br>
addr.sin_addr.s_addr = htonl(INADDR_ANY);<br>
<br>
if(bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) return false;<br>
<br>
...//читаем из сокета данные<br>
Answer the question
In order to leave comments, you need to log in
Try to change addr.sin_addr.s_addr to a real IP or at least loopback
Does it work on Windows/Linux?
Forgotten in the manifest
<uses-permission android:name="android.permission.INTERNET" />
?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question