udp sockets

Discussion in 'C++' started by toobee84@googlemail.com, Dec 2, 2008.

  1. Guest

    hi,

    i am looking around the internet for a while now..... with no helpful
    results.

    i'm using udp-socket in a program what works fine so far until the
    point i try to send a package with a size that exceeds the usual
    ~1500Byte/package.
    the sendto()-call gives me then a "Message too long" error. Do i have
    to make the fragmentation of the package myself or does the socket-API
    provides any function to split the packages ?

    if i have to do it myself how can i set the fragmentation bit in the
    header file to tell the "socket" that i'm sending a splitted package?
    (i know that i can use raw-sockets to set the whole header but that
    have to work with usual SOCK_DGRAM somehow?)

    can someone gives me a clue or a answer, i need to send udp-packages
    (or split them) with a total size of 10.000 - 30.000 Byte
     
    , Dec 2, 2008
    #1
    1. Advertising

  2. Lionel B Guest

    On Tue, 02 Dec 2008 02:33:26 -0800, wrote:

    > hi,
    >
    > i am looking around the internet for a while now..... with no helpful
    > results.
    >
    > i'm using udp-socket in a program what works fine so far until the point
    > i try to send a package with a size that exceeds the usual
    > ~1500Byte/package.
    > the sendto()-call gives me then a "Message too long" error. Do i have to
    > make the fragmentation of the package myself or does the socket-API
    > provides any function to split the packages ?
    >
    > if i have to do it myself how can i set the fragmentation bit in the
    > header file to tell the "socket" that i'm sending a splitted package? (i
    > know that i can use raw-sockets to set the whole header but that have to
    > work with usual SOCK_DGRAM somehow?)
    >
    > can someone gives me a clue or a answer, i need to send udp-packages (or
    > split them) with a total size of 10.000 - 30.000 Byte


    And your C++ *language* question was...?

    Please see:

    http://www.parashift.com/c -faq-lite/how-to-post.html#faq-5.9

    --
    Lionel B
     
    Lionel B, Dec 2, 2008
    #2
    1. Advertising

  3. On Dec 2, 10:33 am, ""
    <> wrote:

    > i am looking around the internet for a while now..... with no helpful
    > results.
    >
    > i'm using udp-socket in a program what works fine so far until the
    > point i try to send a package with a size that exceeds the usual
    > ~1500Byte/package.
    > the sendto()-call gives me then a "Message too long" error. Do i have
    > to make the fragmentation of the package myself or does the socket-API
    > provides any function to split the packages ?


    What operating system are you using?

    If it is Linux, then man udp(7):

    http://www.kernel.org/doc/man-pages/online/pages/man7/udp.7.html
    <q>
    By default, Linux UDP does path MTU (Maximum Transmission Unit)
    discovery. This means the kernel will keep track of the MTU to a
    specific target IP address and return EMSGSIZE when a UDP packet
    write exceeds it. When this happens, the application should
    decrease the packet size. Path MTU discovery can be also turned
    off using the IP_MTU_DISCOVER socket option or the
    /proc/sys/net/ipv4/ip_no_pmtu_disc file; see ip(7) for details.
    When turned off, UDP will fragment outgoing UDP packets that
    exceed the interface MTU. However, disabling it is not
    recommended for performance and reliability reasons.
    </q>

    --
    Max
     
    Maxim Yegorushkin, Dec 2, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sven Jacobs

    UDP sockets

    Sven Jacobs, May 9, 2004, in forum: C++
    Replies:
    1
    Views:
    2,040
    Christopher Benson-Manica
    May 11, 2004
  2. Zunbeltz Izaola

    Python and UDP sockets

    Zunbeltz Izaola, Oct 21, 2003, in forum: Python
    Replies:
    3
    Views:
    464
    Zunbeltz Izaola
    Oct 21, 2003
  3. Zunbeltz Izaola

    UDP sockets

    Zunbeltz Izaola, Oct 22, 2003, in forum: Python
    Replies:
    4
    Views:
    541
    Peter Hansen
    Oct 22, 2003
  4. 7stud

    udp, datagram sockets

    7stud, Aug 6, 2007, in forum: Python
    Replies:
    6
    Views:
    485
    7stud
    Aug 6, 2007
  5. 7stud

    sockets -- basic udp client

    7stud, Feb 15, 2008, in forum: Python
    Replies:
    12
    Views:
    771
    7stud
    Feb 17, 2008
Loading...

Share This Page