I and a few others are doing an academic project on multiplayer game using jme. We would like to target it at Android, our application works on PC using the bundled network engine in JME3 but it always returns a socket exception when deployed on a Android device

We’ve used fairly long time to troubleshoot / trial n error, shutting down the device firewall, trying different forms of network connections, rolling back to earlier versions and trying the multiplayer example.

We found that the server socket can be created, when the client connects it dies out, the same happens when we deploy the monkeyzone example on the device which is a Galaxy Nexus running 4.0.2

Any ideas or help would be highly appreciated

my apology just found out that i posted in the wrong subforum, could an admin move this to right category ty

This may be an obvious question but have you requested network access in your android manifest?

(I know it won’t work if you don’t - I’m not quite sure what the failure symptoms are though off hand so it may or may not match what you are seeing)

Basically we tried almost all google’able solutions including the one you mentioned, no luck, we are trying to deploy the app on another device to narrow down the problem

Could you post the exception?

Spider monkey has never been tested on Android though…

Hi, I am one of the programmer of williehk .

The exception is as below:

E/AndroidHarness(23512): Exception thrown in Thread[GLThread 1447,5,main]

E/AndroidHarness(23512): com.jme3.network.kernel.KernelException: Error hosting:/

E/AndroidHarness(23512): at com.jme3.network.kernel.tcp.SelectorKernel.initialize(SelectorKernel.java:98)

E/AndroidHarness(23512): at com.jme3.network.base.KernelAdapter.initialize(KernelAdapter.java:101)

E/AndroidHarness(23512): at com.jme3.network.base.DefaultServer.start(DefaultServer.java:158)

E/AndroidHarness(23512): at mygame.Main.simpleInitApp(Main.java:95)

E/AndroidHarness(23512): at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:228)

E/AndroidHarness(23512): at com.jme3.app.AndroidHarness.initialize(AndroidHarness.java:418)

E/AndroidHarness(23512): at com.jme3.system.android.OGLESContext.initInThread(OGLESContext.java:237)

E/AndroidHarness(23512): at com.jme3.system.android.OGLESContext.onSurfaceCreated(OGLESContext.java:203)

E/AndroidHarness(23512): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1432)

E/AndroidHarness(23512): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1202)

E/AndroidHarness(23512): Caused by: java.net.SocketException: socket failed: EACCES (Permission denied)

E/AndroidHarness(23512): at libcore.io.IoBridge.socket(IoBridge.java:573)

E/AndroidHarness(23512): at java.net.PlainSocketImpl.create(PlainSocketImpl.java:201)

E/AndroidHarness(23512): at java.net.PlainServerSocketImpl.create(PlainServerSocketImpl.java:38)

E/AndroidHarness(23512): at java.net.ServerSocket.(ServerSocket.java:59)

E/AndroidHarness(23512): at java.nio.ServerSocketChannelImpl$ServerSocketAdapter.(ServerSocketChannelImpl.java:110)

E/AndroidHarness(23512): at java.nio.ServerSocketChannelImpl.(ServerSocketChannelImpl.java:50)

E/AndroidHarness(23512): at java.nio.SelectorProviderImpl.openServerSocketChannel(SelectorProviderImpl.java:45)

E/AndroidHarness(23512): at java.nio.channels.ServerSocketChannel.open(ServerSocketChannel.java:60)

E/AndroidHarness(23512): at com.jme3.network.kernel.tcp.SelectorKernel$SelectorThread.connect(SelectorKernel.java:247)

E/AndroidHarness(23512): at com.jme3.network.kernel.tcp.SelectorKernel.initialize(SelectorKernel.java:95)

E/AndroidHarness(23512): … 9 more

E/AndroidHarness(23512): Caused by: libcore.io.ErrnoException: socket failed: EACCES (Permission denied)

E/AndroidHarness(23512): at libcore.io.Posix.socket(Native Method)

E/AndroidHarness(23512): at libcore.io.BlockGuardOs.socket(BlockGuardOs.java:169)

E/AndroidHarness(23512): at libcore.io.IoBridge.socket(IoBridge.java:558)

E/AndroidHarness(23512): … 18 more

@fortehk said:
E/AndroidHarness(23512): com.jme3.network.kernel.KernelException: Error hosting:/

I'm not familiar with spider monkey but this looks very wrong to me. is not a valid ip address for anything...

Are you sure you're picking up the ip to connect to correctly?