Nature of Sockets?
Ok, i have a nice little server class that im developing, and i want to know, if when my computer recieves a udp packet, if EVERY recvfrom()-ing socket will recieve that message or not, or if i simply wont be able to create and bind another socket, or what, because that would greatly complicate my server model (with a thread to process the Logon Messages, one for Position updates (though one main thread recieves them all, for the sake of not holding up the recieveing thread ive moved the other functions into different threads, some of which WILL require recieveing a message specific to that thread ie: compltely irrelevant to other threads ) and yeah)
if anyone gets what im talking about thanx
ps: i made it a class so that the members could be global to all the threads, but do i need to specify them as volatile?
thanx
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
No one knows? or just no one bothers to answer? plz
-Dan
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
No one? thought this was easy...
edit: thought it SHOULD be easy
[edited by - Ademan555 on March 4, 2004 9:01:41 PM]
edit: thought it SHOULD be easy
[edited by - Ademan555 on March 4, 2004 9:01:41 PM]
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
You should never bind several sockets to the same port. The behaviour depends entierly on the platform. If the binding actually succeds, the packet can get to any socket randomly, it can get to all of them, or it might not get through at all. It can even be a combination of all above, with different results for each packet.
Naturally if you bind the sockets to different ports, then only the socket that is bound to that port will recieve the packet.
Naturally if you bind the sockets to different ports, then only the socket that is bound to that port will recieve the packet.
I like the binding to a different port idea, thanx, now i hafta ask what the significance of the htonl() does... i mean, it reverses the bit order... but... why is that necessary?
-Dan
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement