Used the example provided in https://www.b4x.com/android/forum/threads/websocket-client-library.40221/page-4#posts
B4J command line app runs within the B4J IDE:
I don't know where the magic number 192.168.0.100 in the B4a app comes from (a comment should have helped) in the
I suppose it is the IP address of computer running the b4j app. I plugged the computer ip address (same network as b4a app) into the above string. I even added the manifest permission for internet. But, nothing helps.
Toast message appears containing connection refused
Android 8
targetSDK 29
Firewall of PC may be a problem as it usually prompts me when an exe tries to access a network. But, I have no idea about B4J CLI apps. I used the recommended port.
B4J command line app runs within the B4J IDE:
B4J IDE Log Messages:
Waiting for debugger to connect...
Program started.
2023-05-23 22:16:12.605:INFO :oejs.Server:main: jetty-11.0.9; built: 2022-03-30T17:44:47.085Z; git: 243a48a658a183130a8c8de353178d154ca04f04; jvm 11.0.1+13
2023-05-23 22:16:12.804:INFO :oejss.DefaultSessionIdManager:main: Session workerName=node0
2023-05-23 22:16:12.853:INFO :oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@50b5ac82{/,file:///D:/ANDROI~1/WEBSOC~1/B4JSER~1/B4A-WE~1/Objects/www,AVAILABLE}
2023-05-23 22:16:12.925:INFO :oejs.RequestLogWriter:main: Opened D:\Android-B4A-works\Websockets\b4j server\B4A-WebSocket\Objects\logs\b4j-2023_05_23.request.log
2023-05-23 22:16:13.069:INFO :oejs.AbstractConnector:main: Started ServerConnector@709ba3fb{HTTP/1.1, (http/1.1)}{0.0.0.0:51042}
2023-05-23 22:16:13.096:INFO :oejs.Server:main: Started Server@6580cfdd{STARTING}[11.0.9,sto=0] @1424ms
Emulated network latency: 100ms
I don't know where the magic number 192.168.0.100 in the B4a app comes from (a comment should have helped) in the
whose address is this:
Private link As String = "ws://192.168.0.100:51042/ws"
I suppose it is the IP address of computer running the b4j app. I plugged the computer ip address (same network as b4a app) into the above string. I even added the manifest permission for internet. But, nothing helps.
Toast message appears containing connection refused
Android 8
targetSDK 29
Firewall of PC may be a problem as it usually prompts me when an exe tries to access a network. But, I have no idea about B4J CLI apps. I used the recommended port.
Last edited: