Advertisement

Question on UDP with IPV6

Started by February 26, 2002 11:00 AM
1 comment, last by sfxman 22 years, 10 months ago
Hi, I''m develloping a network library for my game and i have a probleme when working with udp. I''ve seen in examples from microsoft that they use udp transmissions with send and recv instead of sendto and recvfrom, but i''d like to use recvfrom and sendto anyway (for multicast support (maybe i''m wrong, tell me ...)). The probleme is when i try to send a datagram on a multicast group, the send function doesn''t work (no address given it says (last err : 10057)). Can someone give me some pointers about this problem ? Maybe i can change the use of the socket back from send to sendto ? That way it would work better i gues, but i can''t figure out how to get the address out of the SOCKADDR_STORAGE structure ... Any help would be appreciated ! :-) Thanx in advance ! Matt
I''m not an expert on this, but I think its against the design of UDP to send() data on a UDP socket. UDP sockets are unconnected sockets so you have to use sendto(). What MS samples are you talking about?

Also, are you building your sockaddr structure? You have to do that before you connect in the first place (if you''re using send()). If you''re using sendto(), you have to build it and pass it as an arg. What do you mean you''re having a hard time getting the address from it? You should already have it. Let me know more...

-Fred
Advertisement
You can bind a destination address to a udp socket, and it will use that bounded address when you call send.
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

This topic is closed to new replies.

Advertisement