Archived

This topic is now archived and is closed to further replies.

getting UDP to work

This topic is 5045 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

TCP is too slow for me, but I can''t find any good examples for sending and receiving a message with UDP. I have looked at Beej''s thing and it was completely useless for me. Can anyone post a quick code sample showing how to receive the packet that I send with sendto using recvfrom and WSAAsyncSelect?

Share this post


Link to post
Share on other sites
For over an hour.

[edit] Stupid C++ didn't trigger a syntax error when I forgot the parenthesis after a function call (must have interpreted it as something else). All fixed now .

[edited by - Raloth on February 21, 2004 9:41:00 PM]

Share this post


Link to post
Share on other sites
Not using the parentheses means the value of the symbol (i e, address of the function).

Most C++ compilers allow you to turn on warnings that will tell you when you do this.

Most good C++ compilers allow you to treat warnings as errors, so you have no choice but to fix the warnings (all of them!).

I suggest you figure out how to do this, as it probably would have told you about this case (i e, either "value not used" or "cast from pointer to int").

Share this post


Link to post
Share on other sites
Well im glad you got your problem fixed.

I searched google and no theres not a whole lot out there in one spot on this specific topic, but theres enough spread around that you could cobble something together.

As far as warnings/errors go, even if I compile and get only warnings I usually fix those as I tend to treat them as errors out of habit. I usually let ones like int to float conversion warnings slide for a bit but eventually I go back and tidy them up and make em go away.

-=[ Megahertz ]=-

Share this post


Link to post
Share on other sites