B4aserver help


Licensed User
Longtime User
I'm using the example from this post as is.

I run.bat on my computer and the command window shows

server.jar anywheresoftware.b4a
B4A server (v0.92) is started.
_server.php, server name=test1
then I press the DIR button on my phone and the command window on my computer shows this:
trying to connect to: xx.xxx.95.41:7890
Error occurred while working with ip: xx.xxx.95.41:7890
java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at anywheresoftware.b4a.b4aserver.Communicator.run(Communicator.java:38)

at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

What's going wrong? When I do a whatsmyip from my phone it doesn't match the ip in the command window but in the settings of my phone the ip does match the command window.
My guess is Bell Mobility somehow reroutes my ip????
Is there a way to send my other ip to the server?

is this error just a time out.


Licensed User
Longtime User
I'm bummed. No replies so no solution so far.
I've seen some other posts where people have similar ip issues due to there phone provider.
Erel, is it possible to modify the desktop server to accept a different ip that could be sent when initializing it from the phone app, if that makes sense?
Upvote 0


Licensed User
Longtime User
It is possible that ServerSocket.GetMyIP returns the mobile IP instead of the wifi IP. You can try to disable the Mobile network and see if it works.
Thanks for the new network library.
I'm not using wifi, but I did try it and I connect fine.
I'm trying to use the server over the mobile neetwork only.
My problem is that my phones mobile ip reports 10.x.x.114 , but if I go online to whatsmyip website and check my phones ip, it shows it as 184.x.x.158.
I tried putting the ip I got from whatsmyip into the
Sub SendConnectionMessageToBoard right after
ip = server.GetMyIP ' I put
ip = 184.x.x.158
no luck, although the desktop server did report
trying to connect to: 184.x.x.158:7890
but then the same message as shown in first post.
Any ideas?
Upvote 0


Licensed User
Longtime User
Thanks for the info Erel. I only need to run a program on the desktop, perhaps I can write a program on the desktop that when I upload a file by ftp it will run the desktop program that I need to use to update another file, if that makes sense
Upvote 0