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
 
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
Top