Connecting a group of devices?

ondesic

Active Member
Licensed User
Longtime User
I want to connect multiple devices to a network. I have successfully connected two devices with a WiFi and Bluetooth network. I used a Socket, AsyncStreams, ServerSocket and Serial object.

After I connect two devices, I try to connect a third one. However when I try to connect another, it closes one of the connection. What can I do?
 

ondesic

Active Member
Licensed User
Longtime User
Darn, I was hoping someone would have an answer to this by now.

Regardless, I've made a little head way. On the server side I created an array of Socket objects because I read that you must have a new socket for each connection.

This has also forced me to make an array of AsyncStream objects.

The device that is the server can send data to all other connected devices. HOWEVER, if the client makes a change, it only updates the server but not the other connected clients.

So 2 questions:

1) How do I make it so ALL devices connected can send data to everyone?
2) Is there a better way to do this other than using arrays of socket and asyncstreams?
 
Last edited:
Upvote 0

derez

Expert
Licensed User
Longtime User
1. Send the data to the server, then let the server send the data to all members except the sender.
If you want to send only from one sender to one reciever - they should both connect with a separate socket between them (after coordination by chat or by talking...)
2. That is a must.
 
Upvote 0
Top