Luke
Luke

Reputation: 14128

Sockets in a "group" setting?

Typically you have a server and client pair or two peers that connect to each other through a socket. This is a 1 to 1 relationship.

Lets say you had 6 peers. Is there a way for them to be "grouped" together without a "server" so that 1 peer can send a udp/tcp message directly to another?

I'm basically looking for a way to do this without having to set up a separate socket for each relationship.

If this is possible, what are the correct terms?

Upvotes: 0

Views: 224

Answers (2)

Chad
Chad

Reputation: 19022

UDP sockets can send data through a non-connected socket using the sendto() function. Endpoints specified have to be listening on the given IP/port but do not have to have already initiated a connection.

Upvotes: 0

Nikolai Fetissov
Nikolai Fetissov

Reputation: 84151

No easy way with TCP, but with UDP you have multicast.

Upvotes: 1

Related Questions