B4J Question jRDC2 connection via linux server

Hi i have a problem connecting my jRDC2 connector in my linux server to my b4a app.

In my CentosOS 7
i run my jrdc2
and open my server port using :
sudo iptables -I INPUT -p tcp -m tcp --dport 17170 -j ACCEPT

then
curl http://xxx.xxx.xxx.xx:17170/test
and get an output

RemoteServer is running (03/30/2021 06:22:32)<br/>Connection successful.-sh-4.2$

but when i run through my windows browser i get an error :
This site can’t be reached
xxx.xxx.xxx.xxx took too long to respond.


Try:
ERR_CONNECTION_TIMED_OUT


and when i run my b4a app i get an error :

ERROR: java.net.SocketTimeoutException: failed to connect to /xxx.xxx.xxx.xxx (port 17170) from /172.16.0.167 (port 37550) after 30000ms

what should i do?
 

DonManfred

Expert
Licensed User
Longtime User
 
Upvote 0
I'd try to do this steps but the output is the same.

I don't know where did i gone wrong
 
Last edited:
Upvote 0
This error means that you are running multiple instances of jRDC2 and the socket is already held by the previous one.

Find all java processes and kill them: ps -ef | grep java
kill <pid number>

I kill all the java process and remain one process running
but it's connection refused. output

1617714803823.png
 
Upvote 0
Restart the server and run a single one.

You can then test it with curl 127.0.0.1:17170/test

The result is fine

RemoteServer is running (03/30/2021 06:22:32)<br/>Connection successful.-sh-4.2$

But i can't connect to my b4a apk

ERROR: java.net.SocketTimeoutException: failed to connect to /xxx.xxx.xxx.xxx (port 17170) from /172.16.0.167 (port 37550) after 30000ms
 
Upvote 0

hibrid0

Active Member
Licensed User
Longtime User
The result is fine

RemoteServer is running (03/30/2021 06:22:32)<br/>Connection successful.-sh-4.2$

But i can't connect to my b4a apk

ERROR: java.net.SocketTimeoutException: failed to connect to /xxx.xxx.xxx.xxx (port 17170) from /172.16.0.167 (port 37550) after 30000ms
I have the same problem. The test work OK.
Access In web browser is ok.
But from the android app can't connect. 😕😕😕
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
I have the same problem. The test work OK.
Access In web browser is ok.
But from the android app can't connect.
Start a new thread and give us some more info. Where is the server installed (IP, if possible). What machine did you run the test access from (IP again). What is the IP for the phone you are using for testing? What URL are you using in the app? Etc..
 
Upvote 0
Top