Android Question Socket Server in B4A with multible inbound connections

TheMightySwe

Active Member
Licensed User
Longtime User
Hi,

Quick question, has anyone a code snippet how to have one server socket listening and be able to connect several clients to that socket in a simple way. I need to send and recieve varables like a list of maps through the connection.

// TMS
 

Lee Gillie CCP

Active Member
Licensed User
Longtime User
Check the tutorial. There are tons of great examples prepared with explanations. A lot of great work already done, seek it out.

It is not clear to me if the NEWCONNECTION event arrives on the main thread or not. My guess is that it does. So the only thing I might add is that if your connections are long-lived (not quick and transitory), then you can spin the NEWCONNECTION event into a new thread just prior to the call to LISTEN in NEWCONNECTION. Dynamically connect event handlers to NewSocket in this case. If you simply reply and close, then none of this is necessary of course.

HTH
 
Upvote 0

TheMightySwe

Active Member
Licensed User
Longtime User
It is long lived connections, and the first part is already done, the part in the tutorial. So I try to figure it out my self.
 
Upvote 0
Top