开发者

socket exception in android

开发者 https://www.devze.com 2023-02-13 12:39 出处:网络
I am trying to write a simple UDP se开发者_如何学编程rver for android and when I run it I get the following exception: \"java.net.socketException: Permission Denied\" I tried to add the permission to

I am trying to write a simple UDP se开发者_如何学编程rver for android and when I run it I get the following exception: "java.net.socketException: Permission Denied" I tried to add the permission to my menifest (<uses-permission android:name="android.permission.INTERNET" />) but I still get the same exception. the code that causes the exception is:

int in_port = 61000
DatagramSocket server_socket = new DatagramSocket(in_port);

Does someone know what the problem might be?

Thanks, Binyamin


Could this be your solution?. Post your manifest file on here.

Its also possible that your socket is in use. In this case set the socket as reusable


Please add details to your question.

If you are setting up your emulator as a server see this thread;

0

精彩评论

暂无评论...
验证码 换一张
取 消