1

I am trying to write a simple UDP server 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

MByD
  • 135,866
  • 28
  • 264
  • 277
  • Can you post relevant section of your manifest file? Did you run this code on emulator or device? – Samuh Feb 27 '11 at 06:57
  • Thanks for the answers, I found a problem in my menifest file but I don't know how to delete question... – MByD Feb 27 '11 at 09:07
  • you shouldn't delete the question. Mods probably wont allow you to. If this is a duplicate however, let us know, we will flag it. – Reno Feb 27 '11 at 21:53

2 Answers2

0

Please add details to your question.

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

Samuh
  • 36,316
  • 26
  • 109
  • 116
0

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

Community
  • 1
  • 1
Reno
  • 33,594
  • 11
  • 89
  • 102
  • Surely a better idea would be to post a bit of code here? Links expire, but if you had a part of the solution here, at least we could have a quick look and explore further if needed. – marienke Aug 22 '17 at 06:54