B4J Question Multiply connection

micro

Well-Known Member
Licensed User
Longtime User
Hi to all
I have 60 device configured as a server, now I, from the pc to connect with them (writing and reading)
can I create multiple client connections for each device and thus have independence in the connections?
Each connection must update a data table for each device.
With a single connection I lose time to interrogate a device at a time.
It's possibile with B4j?
Thanks
 

ArminKH

Well-Known Member
yes you can
i think you should following this steps
1-At first you must register your users with specific ID on your Online Database
2-build your server by b4j
3-connect to server from b4a
4-if connected then you can send your user id to server
5-if ID recieved to server side then you can select and update your online data base 4 Relevant ID
now any other user on your server can recieve updated data
i think this steps are correct but @Erel can said this is correct and is best way or not
regards
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

micro

Well-Known Member
Licensed User
Longtime User
Excuse me Erel antother question (a bit of confusion), I decided for ease to use the example of CCTV.
As I said, the devices are server and the descktop application (b4j) is the client, in b4j
i have to create n client for ever device and use different port?

B4X:
Private client_1 As Socket
Private client_2 As Socket
..........
client_1.Initialize("client_1")
client_2.Initialize("client_2")
..........
client_1.Connect(ip1, 6001, 5000)
client_2.Connect(ip2, 6002, 5000)
..........

Is this correct?
Or do you recommend another solution?
 
Upvote 0

micro

Well-Known Member
Licensed User
Longtime User
No. See the example.
Ok....
It's possible send the same data to a group of ip without cycling the various ip?
If more device trasmitting at the same time (It is easy to occur), I can lose some data?
The stack TCP/IP as it is wide?
I'm sorry but I have to study well the best mode
 
Last edited:
Upvote 0
Top