Use send() instead of sendto() for UDP
Hi,
Can I use send() function to send UDP datagram through a socket instead of calling the sendTo()? |
Hey,
it would help to check the man page for the send(2) system call. "The send() call may be used only when the socket is in a connected state (so that the intended recipient is known)." As per definition, UDP is never in a connected state, so that you can't use send(2) instead of sendto(2). - Andi - |
Ah okay, that explains why I still can use send(); that's because my implementation of UDP is a "connected" state by calling to connect() before send().
Thanks! |
All times are GMT -5. The time now is 06:28 AM. |