Question regarding UDP sockets... - Unix

This is a discussion on Question regarding UDP sockets... - Unix ; How can I tell if a given UDP socket has been created on a remote host? I have the host IP and the socket port number but it is my understanding that I cannot just sendto() a message to the ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Question regarding UDP sockets...

  1. Question regarding UDP sockets...

    How can I tell if a given UDP socket has been created on a remote host? I
    have the host IP and the socket port number but it is my understanding that
    I cannot just sendto() a message to the remote socket since the return value
    of sendto() does not indicate whether the remote UDP socket has actually
    received the message.

    Any help would be appreciated.



  2. Re: Question regarding UDP sockets...

    In article ,
    "barcaroller" wrote:

    > How can I tell if a given UDP socket has been created on a remote host? I
    > have the host IP and the socket port number but it is my understanding that
    > I cannot just sendto() a message to the remote socket since the return value
    > of sendto() does not indicate whether the remote UDP socket has actually
    > received the message.
    >
    > Any help would be appreciated.


    Use connect(), and then try to send() over the socket. If the remote
    host sends back an ICMP Port Unreachable, the next call on the socket
    will return an error.

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***

+ Reply to Thread