Is there any way to use the socket port lower than 1024 (eg. 223) in Android platform

by sharon....@gmail.com » Sun, 15 Mar 2009 13:13:54 GMT


Sponsored Links
 Is there any way to use the socket port lower than 1024 with class
MulticastSocket? My application has to use this port to receive data
from other official tool which I can not change.  But
java.net.BindException happend when I new a MulticastSocket instance.
I've added INTERNET permission and I can create the socket if I change
it to other port bigger than 1023.

Source code : sock = New MulticastSocket(223)

Log:
I/System.out(  279): SocketException happend
W/System.err(  279): java.net.BindException: Permissions do not allow
action on socket
W/System.err(  279):    at
org.apache.harmony.luni.platform.OSNetworkSystem.socketBindImpl2
(Native Method)
W/System.err(  279):    at
org.apache.harmony.luni.platform.OSNetworkSystem.bind2
(OSNetworkSystem.java:145)
W/System.err(  279):    at
org.apache.harmony.luni.net.PlainDatagramSocketImpl.bind
(PlainDatagramSocketImpl.java:119)
W/System.err(  279):    at java.net.MulticastSocket.createSocket
(MulticastSocket.java:564)
W/System.err(  279):    at java.net.DatagramSocket.<init>
(DatagramSocket.java:82)
W/System.err(  279):    at java.net.MulticastSocket.<init>
(MulticastSocket.java:60)
W/System.err(  279):    at com.android.sockport.SocketPort.onCreate
(SocketPort.java:28)
W/System.err(  279):    at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1122)
W/System.err(  279):    at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2103)
W/System.err(  279):    at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2156)
W/System.err(  279):    at android.app.ActivityThread.access$1800
(ActivityThread.java:112)
W/System.err(  279):    at android.app.ActivityThread$H.handleMessage
(ActivityThread.java:1580)
W/System.err(  279):    at android.os.Handler.dispatchMessage
(Handler.java:88)
W/System.err(  279):    at android.os.Looper.loop(Looper.java:123)
W/System.err(  279):    at android.app.ActivityThread.main
(ActivityThread.java:3742)
W/System.err(  279):    at java.lang.reflect.Method.invokeNative
(Native Method)
W/System.err(  279):    at java.lang.reflect.Method.invoke(Method.java:
515)
W/System.err(  279):    at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:739)
W/System.err(  279):    at com.android.internal.os.ZygoteInit.main
(ZygoteInit.java:497)
W/System.err(  279):    at dalvik.system.NativeStart.main(Native
Method)

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. VerticalScrollBar Size is never the same for the same screen

I forget the link

http://yfrog.com/0pdevice1ylpx




-- 

2. VerticalScrollBar Size is never the same for the same screen

Hello,

Here are two screencast of the same screen but in different position.
The VerticalScrollBar has not the same size.
Do you know what is the problem ?

Thanks for your help.

-- 

3. Inconsistant naming for SDK 2.1

4. Maintaining a free and paid version & maybe other version

5. Any experienced Greystripe users?

6. Socket Rocket - Im losing my mind!

7. InstrumentationTestRunner Error Help!