-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to bind the socket to a port less than 1024 #45
Comments
@VijayLogitech does it work when you use a MulticastSocket natively (not via react-native-udp -> GCDAsyncUdpSocket)? |
@mvayngrib hi, sorry for the late reply, need ur help here. filename : android/src/main/java/com/tradle/react/UdpSocketClient.javaandroid/src/main/java/com/tradle/react/UdpSocketClient.java public void bind(Integer port, @nullable String address) throws IOException { |
To bind to a port less than 1024, you need to be root. On Android, there are two ways of doing that: being System app or su binary. (More info on this StackOverflow answer). |
i am trying to convert my native app, to react-native for code sharing between android and ios. in my application, i use react-native-udp to detect the devices connected to the wifi. In my native application, i bind to a port 137, to detect a specfic type of device. When i try to recreate the same in react-native-udp, during bind, 137 it gives me error "EACCESS". the only difference i see from the native application code and react native udp code is, native application uses DatagramSockets(), where as react-native-udp is using MulticastSocket().
//new MulticastSocket(port);
Can you please make it work for binding to a port less than 1024?
The text was updated successfully, but these errors were encountered: