UDP sockets (SOCK_DGRAM) in Linux

UDP sockets (SOCK_DGRAM) in Linux

Post by Shay » Sun, 15 Nov 1998 04:00:00


        I understand that UDP is considered "unreliable" in the sense that
there is no way to track a UDP packet that it will indeed arrive to the
other side, and that when sending few packets, they might not get to the
other side in the order which is wished.

        About the second part (order of packets arriving might be
corrupted) - let's say I have a server which uses recvfrom() to block, and
waits for some data to arrive.
        The other side sends a buffer with 4k length to that server using
sendto() - does that mean that this buffer might be splitted into
two udp packets, and that the other side might get the wrong part of the
buffer first?
        Or is UDP not THAT unreliable, and if I use sendto() and other
side uses recvfrom() - and it indeed receives SOME data, it is guranteed
that it is exactly that 4k buffer as I sent it (meaning - one UDP packet
contains the whole buffer).

        And another thing is - how can I know what is the maximum size of
buffer I can use with sendto() and recvfrom() for sending data (if
indeed one sendto() with a buffer is sent in a single udp packet)?

        Please e-mail me if possible, in addition to the newsgroup post.




Hello.  I'm going crazy from getting ECONNREFUSED
error when I attempt to recv() after doing a send()
to server.  Followed code on pg 400ish of
Steven's "UNIX Network Programming" and not
sure why I'm getting this error.  Any advice

socket(), connect() and send() seem to have each
completed successfully.



2. DVD: latest word?

3. How to receive UDP and ICMP packet using one UDP socket, (Path MTUD)

4. multiple linux installations on one machine

5. aplication to receive [ethernet|IP|UDP] and [ethernet|ppp|IP|UDP] packages over socket

6. Mysql trouble

7. application to receive ethernet|IP|UDP a ethernet|ppp|IP|UDP packages over socket

8. 'bad intefaces address' with wireless!!

9. socket(SOCK_DGRAM): Too many open files

10. named : socket(SOCK_DGRAM): Too many open files - exiting

11. Reliability of SOCK_DGRAM Unix-Domain sockets

12. named : socket(SOCK_DGRAM): Too many open files - exiting

13. socket(AF_PACKET, SOCK_DGRAM, htons(ETH_P_IP)) broken?