Re: How to uniquely identify a UDP session at Winsock layer?
- From: "Omar [MS]" <omarm@xxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 30 May 2005 20:01:10 -0700
For UDP, once a send is done, the socket will be auto-bound if it has not
been previously bound. After which time you may call getsockname() to find
out where it got bound to. Of course if you want to make sure to bind it to
a particular interface you can just do that by calling bind() to explicitly
bind the socket the interface you want.
Thanks,
- Omar
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Please do not send
email directly to this alias. This alias is for newsgroup purposes only.
"ganesan" <ganesan.nagrajan@xxxxxxxxx> wrote in message
news:1115922401.192064.115530@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi all
>
> I had posted a question on Winsock UDP. Probably its wasn't corretly
> stated.
>
> This is what I am looking for.
>
> Theoretically, I guess, a connection or session in uniquely identified
> by "Source IP, Source port, Destination IP, Destination port".
>
> If you are below the TCP/IP stack you will get these for any
> adapter(both for TCP and UDP).
>
> When you are at Winsock or LSP level, we may not able to know which
> adapter is used for connection, if there are mulpitle adapters running
> simultaneously. Of course in case of TCP once the connection is done
> using WSPConnect() call, we can use the getsockname(),
> WSPGetSockName(), gethostbyname() etc. calls to find the correct
> source IP address and port used for that particular connection.
>
> But for UDP, it may not be the case. User just creates a socket() and
> calls Sendto(). The call socket() doesn't establish any connection i
> guess. So when a sendto() call is made, i don't know which adapter is
> used for sending the data and thus i don't know the local IP and port
> used.
>
> So, How to uniquely identify a UDP session at the Winsock level,
> knowing that both sendto() and recvfrom calls() has only the remote
> host info?
>
> Thanks for any help.
>
> Ganesan
>
.
- References:
- How to uniquely identify a UDP session at Winsock layer?
- From: ganesan
- How to uniquely identify a UDP session at Winsock layer?
- Prev by Date: Re: Are tcp/udp/ip packets the same format for windows ce & palm OS?
- Next by Date: Re: Copy file to a second Pocket PC
- Previous by thread: How to uniquely identify a UDP session at Winsock layer?
- Next by thread: Are tcp/udp/ip packets the same format for windows ce & palm OS?
- Index(es):
Relevant Pages
|