Game Development Community

Sending a packet to all clients w/ just a NetInterface

by Ryan · in Torque Game Engine · 01/24/2007 (11:00 am) · 3 replies

How do you spam a packet to all clients from a server's NetInterface? We're not using Connections so postNetEvent calls will not work.

Do I just have to iterate through all mSockets and call sendto(mSocket, ...) for each one?

About the author


#1
02/05/2007 (9:18 am)
Why are you not using Connections? They are not TCP connections... they simply wrap the UDP data and provide timeouts on connectivity and many conveniences.

tone
#2
05/10/2007 (1:04 am)
Using EventConnection is more convenient than using sendto. you may set the packet type as unguaranteed packet or guaranteed packet
#3
05/10/2007 (2:40 am)
Sendto () will not work as NetInterface is built around UDP.

There is also (to my knowledge) no place where these UDP addresses are stored before they are added as pending connections or into the connection table, so you will have to modify that yourself and then iterate that list. Shouldn't be too hard.