P Patrick Clark Active Member Licensed User May 25, 2020 #1 I would like to create a nonui server in B4J that can accept requests from another B4J application and supply a response. Unless I am missing something all of the examples I can find use a web page as the querying application and I want to use a B4J application. If I have missed it can someone point me at a suitable example or give me a hand on how to get started. Thanks
I would like to create a nonui server in B4J that can accept requests from another B4J application and supply a response. Unless I am missing something all of the examples I can find use a web page as the querying application and I want to use a B4J application. If I have missed it can someone point me at a suitable example or give me a hand on how to get started. Thanks
Xandoca Active Member Licensed User Longtime User May 25, 2020 #2 Take a look here and here. Maybe it can help you to get started. Upvote 0
P Patrick Clark Active Member Licensed User May 25, 2020 #3 Thanks, they both look like good reading for later. (It 00:50here ?) Upvote 0
P Patrick Clark Active Member Licensed User May 25, 2020 #4 This was perfect advice Thank You. Upvote 0
P Patrick Clark Active Member Licensed User May 26, 2020 #5 I have got the comms working. B4J Server and B4A Client but I need to be able to process multiple connections. The examples seem to only allow one connection at a time. if another connection request is made the original socket is dropped. Can you point me at anything else. I don't mind figuring out how to implement it (that is the fun of it) but i could really use some ideas. I think i need to do something with this line on the server end B4X: Copy astream.InitializePrefix(NewSocket.InputStream, True, NewSocket.OutputStream, "astream") and keep track of a number of streams Upvote 0
I have got the comms working. B4J Server and B4A Client but I need to be able to process multiple connections. The examples seem to only allow one connection at a time. if another connection request is made the original socket is dropped. Can you point me at anything else. I don't mind figuring out how to implement it (that is the fun of it) but i could really use some ideas. I think i need to do something with this line on the server end B4X: Copy astream.InitializePrefix(NewSocket.InputStream, True, NewSocket.OutputStream, "astream") and keep track of a number of streams
Xandoca Active Member Licensed User Longtime User May 26, 2020 #6 It would be my pleasure to help you but I don't know the solution ?. I suggest you create a new post with this specific point (I think you will probably get more answers). Upvote 0
It would be my pleasure to help you but I don't know the solution ?. I suggest you create a new post with this specific point (I think you will probably get more answers).
Erel B4X founder Staff member Licensed User Longtime User May 27, 2020 #8 Patrick Clark said: The examples seem to only allow one connection at a time. if another connection request is made the original socket is dropped. Can you point me at anything else. Click to expand... Yes: 1. MJPEG / CCTV Server 2. [B4X] FTP Server implemented with Socket and AsyncStreams However unless you have a good reason, you will get better results and easier with MQTT or jServer. Upvote 0
Patrick Clark said: The examples seem to only allow one connection at a time. if another connection request is made the original socket is dropped. Can you point me at anything else. Click to expand... Yes: 1. MJPEG / CCTV Server 2. [B4X] FTP Server implemented with Socket and AsyncStreams However unless you have a good reason, you will get better results and easier with MQTT or jServer.
P Patrick Clark Active Member Licensed User May 27, 2020 #9 Erel said: However unless you have a good reason, you will get better results and easier with MQTT or jServer. Click to expand... Thanks Erel. I looked at the jServer examples but I couldn't find any examples of code that didn't implement some kind of browser html, so I moved on. Does jServer allow non-ui/non-web applications to be built and are there any examples. Upvote 0
Erel said: However unless you have a good reason, you will get better results and easier with MQTT or jServer. Click to expand... Thanks Erel. I looked at the jServer examples but I couldn't find any examples of code that didn't implement some kind of browser html, so I moved on. Does jServer allow non-ui/non-web applications to be built and are there any examples.
OliverA Expert Licensed User Longtime User May 27, 2020 #10 Patrick Clark said: Does jServer allow non-ui/non-web applications to be built and are there any examples. Click to expand... Yes 1) WebSockets. See the Push Messaging example (I know it also supports a web front end, but that does not have to be implemented). Source: https://www.b4x.com/android/forum/threads/webapp-web-apps-overview.39811/#content 2) Check out jRDC2. It communicates via serialized data. Source: https://www.b4x.com/android/forum/t...-rdc-remote-database-connector.61801/#content Neither may be a perfect fit, but are options (if you are looking at jServer). Upvote 0
Patrick Clark said: Does jServer allow non-ui/non-web applications to be built and are there any examples. Click to expand... Yes 1) WebSockets. See the Push Messaging example (I know it also supports a web front end, but that does not have to be implemented). Source: https://www.b4x.com/android/forum/threads/webapp-web-apps-overview.39811/#content 2) Check out jRDC2. It communicates via serialized data. Source: https://www.b4x.com/android/forum/t...-rdc-remote-database-connector.61801/#content Neither may be a perfect fit, but are options (if you are looking at jServer).
P Patrick Clark Active Member Licensed User May 28, 2020 #11 Erel said: Yes: 1. MJPEG / CCTV Server 2. [B4X] FTP Server implemented with Socket and AsyncStreams However unless you have a good reason, you will get better results and easier with MQTT or jServer. Click to expand... I am liking MQTT. Can I use MQTT over a Wifi Direct connect between android devices? Upvote 0
Erel said: Yes: 1. MJPEG / CCTV Server 2. [B4X] FTP Server implemented with Socket and AsyncStreams However unless you have a good reason, you will get better results and easier with MQTT or jServer. Click to expand... I am liking MQTT. Can I use MQTT over a Wifi Direct connect between android devices?
Erel B4X founder Staff member Licensed User Longtime User May 28, 2020 #12 Patrick Clark said: Can I use MQTT over a Wifi Direct connect between android devices? Click to expand... I haven't tried it but I expect it to work. Upvote 0
Patrick Clark said: Can I use MQTT over a Wifi Direct connect between android devices? Click to expand... I haven't tried it but I expect it to work.