Impact of bind() on recvfrom() and sendto()

Discussion in 'Linux Networking' started by maruk2, Mar 17, 2007.

  1. maruk2

    maruk2 Guest

    Assume a UDP socket S on a machine with more than one interface card,
    let's say two interface cards with IP addresses IP1 and IP2.
    Also assume that you bind the socket S to IP1 and port P1.

    Does it mean that recvfrom() on socket S will not receive any data
    that came in
    on interface card with IP2 for port P1?

    Does it mean that sendto() will send all datagrams through interface
    card with IP1
    regardless of the target address? What if this conflicts with the
    route table?
     
    maruk2, Mar 17, 2007
    #1
    1. Advertisements

  2. maruk2

    Rick Jones Guest

    When a UDP datagram arrives, it will be handed to the UDP endpoint
    with the closest match on local/remote IP, local/remote port -
    _without_ any conflicting fields.
    All it does in this context is specify the source IP.

    rick jones
     
    Rick Jones, Mar 19, 2007
    #2
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.