|
-
May 8th, 2008, 09:51 PM
#1
Thread Starter
Frenzied Member
Winsock blaster - does one exxist?
Hi,
I was reading about a control for UDP and it said it has a method to blast a message to everyone at once. Does anyone know of a control for TCP that will do that for all connected users instead of looping through and sending the message to each?
I was looking into UDP cause it seemed faster but looks like I may miss some packets and for an online game that may not be too good.
Thanks
-
May 9th, 2008, 02:47 AM
#2
Re: Winsock blaster - does one exxist?
You can use the Winsock Control for either TCP or UDP.
Only UDP can do a broadcast (sending to all at once), since UDP doesn't care if anyone actually receives anything.
TCP ensures that each message is being received at the receiving end, and due to that there can't be a real broadcast.
You either have to use an UDP-broadcast or use a loop that sends all messages via TCP.
BTW: I'm using both, UDP for messages that need to be sent to all, however a missing package is no problem (i.e. The actual situation, if one message is lost, the next contains it all again).TCP for all messages which have to be received (i.e. All Action-messages).
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
May 9th, 2008, 10:27 AM
#3
Re: Winsock blaster - does one exxist?
Most games use UDP for things like keeping track of the movement of an object (current location). In cases like that, losing a packet isn't that big a deal. Another packet will be along soon enough, and the worst that will happen will be that an object "stutters". Losing packets isn't all that common in LAN work, either.
However, if you are using UDP, and you have a really critical message, just have the receiver echo the message back to the sender (when the receiver gets the message, have them send the same message right back). Then the sender keeps re-sending until it receives the echo. Thus, the echo acts as an acknowledgement of the original message.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|