dosida
asked on
UDP Broadcasting Question
ok guys here it comes
Please explain it to me like I'm a five year old
Lets say we have a client/server application right?
When we set the IP Address on 255.255.255.255 and the port
lets say on 2002 using the Winsock Control,will this broadcast it to whatever computer is listening on the
same port, using my client?
Basically What I want to achieve is to broadcast my IP and a random username/userid through UDP so that the program knows where to connect using TCP.
Can that be done and if yes... can you guys give me an example?
Thanks for your time and efford :)
DOSida
Please explain it to me like I'm a five year old
Lets say we have a client/server application right?
When we set the IP Address on 255.255.255.255 and the port
lets say on 2002 using the Winsock Control,will this broadcast it to whatever computer is listening on the
same port, using my client?
Basically What I want to achieve is to broadcast my IP and a random username/userid through UDP so that the program knows where to connect using TCP.
Can that be done and if yes... can you guys give me an example?
Thanks for your time and efford :)
DOSida
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Oh, dont forget to set your winsock controls protocol to UDP on the property view.
also, the remote port in my first code snippet should be 2002
ASKER
Thank you for your Prompt answer, mccainz2 :)
Ok now call me a bit slow but I would like to clarify
a couple of points
1)Will this work if the clients I want to connect to
are on the Internet? Meaning Peer A and Peer B are not
within the same LAN but online from different ISPs, cities,
countries.
2)How many times faster is UDP from TCP?
Regards :)
DOSida
Ok now call me a bit slow but I would like to clarify
a couple of points
1)Will this work if the clients I want to connect to
are on the Internet? Meaning Peer A and Peer B are not
within the same LAN but online from different ISPs, cities,
countries.
2)How many times faster is UDP from TCP?
Regards :)
DOSida
(1)UDP packets are not forwarded by routers. So, they are a LAN only solution. Close your eyes and imagine if broadcasts were forwarded by routers ;)
(2)UDP is a lighter protocol than TCP but as far as performance....No real idea other than UDP should definitely be faster on a LAN but I doubt if that increase in speed would be noticeable, especially running in VB.
(2)UDP is a lighter protocol than TCP but as far as performance....No real idea other than UDP should definitely be faster on a LAN but I doubt if that increase in speed would be noticeable, especially running in VB.
ASKER
Thank you for the clarifications mccaniz2 :)
Let me bug you one last time please :)
(if you want to that is :)
So the only way for me to broadcast my IP address
is to use a server and send it there? Is there
an alternative to this way?
Regards
DOSida
Let me bug you one last time please :)
(if you want to that is :)
So the only way for me to broadcast my IP address
is to use a server and send it there? Is there
an alternative to this way?
Regards
DOSida
Well, if you are talking about publishing your IP so that anyone on the net can find out where you are (your current IP) then yes you are looking at posting your IP to a known server (one that all your clients can poll) and having clients check in with that server to find out where you are (basically how IM works).
Lemme tell a quick story (of which Ive forgotten most of the details). Around 1990 a clever grad student decided to write a lil email virus which he thought would be fairly harmless. Basically it propagated out an email to sun workstations. He envisioned it as dropping a rock in a pond and watching the ripple spread out across the net.
Problem was he forgot that the email not only propagated out but it also propagated back to the computers sending the email...repeat this cycle and you get a tidal wave of disaster building up. NASA wouldnt let their stations back on line for 3 weeks (fuzzy on this but it was a while).
This is basically what would happen if routers forwarded broadcasts. I know you didnt ask but I felt like sharing :)
Lemme tell a quick story (of which Ive forgotten most of the details). Around 1990 a clever grad student decided to write a lil email virus which he thought would be fairly harmless. Basically it propagated out an email to sun workstations. He envisioned it as dropping a rock in a pond and watching the ripple spread out across the net.
Problem was he forgot that the email not only propagated out but it also propagated back to the computers sending the email...repeat this cycle and you get a tidal wave of disaster building up. NASA wouldnt let their stations back on line for 3 weeks (fuzzy on this but it was a while).
This is basically what would happen if routers forwarded broadcasts. I know you didnt ask but I felt like sharing :)