in reply to Re: Socket recv?
in thread Socket recv?

send and recv are calls that can only be used in a connected-state socket (ie TCP).

Replies are listed 'Best First'.
Re^3: Socket recv?
by ikegami (Patriarch) on Mar 11, 2011 at 22:02 UTC

    You have to use send for unconnected sockets. Saying it can't be used for unconnected sockets is nonsense. The system would have no idea where to send the data to.

    Furthermore, UDP sockets can be connected. Connecting a UDP socket specifies the default host+port for sending, and it specifies the only host+port from which it will receive.