View previous topic :: View next topic |
Author |
Message |
ramytabet
Joined: 14 May 2007 Posts: 12
|
Posted: Wed May 16, 2007 3:19 pm Post subject: Question about the code. |
|
|
Hi,
I don't know if this is the best place to post questions about the miniupnpc
code but i just couldn't find a better place to post.
I was just wondering how and why are you using recv() with a UDP socket
in upnpDiscover thru ReceiveData ; isn't recvfrom() used for UDP sockets?
What's the difference between using recv() or recvfrom on a UDP socket?
Thanks |
|
Back to top |
|
|
ramytabet
Joined: 14 May 2007 Posts: 12
|
Posted: Thu May 17, 2007 11:22 am Post subject: Solved ! |
|
|
OK OK,
I have read the MSDN articles concerning recv and recvfrom
and it seems that calling recvfrom on a UDP socket accept any incoming
UDP packet sent to local peer socket and the ip of the sender is filled in
the output parameter of the function whereas recv only accept UDP
packets initiated from the remote sender whose ip has been binded locally.
However i have another question concerning more specifically the UPNP
protocol:
During discovery of upnp supported devices, shouldn't the initiator of the
upnp discovery use a UDP socket binded on port 1900 and receive
(accept) a TCP connection on port 2869 ? If not why is the TCP port 2869
used for , as it is added to the windowsXP firewall ? |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1593
|
Posted: Fri May 18, 2007 9:26 pm Post subject: |
|
|
* For UDP, recv() and recvfrom() are equivalent except that recvfrom() can give the address of the sender of the datagram. calling recv(s, buf, len, 0); is strictly the same as calling recvfrom(s, buf, len, 0, 0, 0);
* TCP stuff on port 2869 is used by Windows for UPnP event notifications. miniupnpd still doesnt manage the event notifications. |
|
Back to top |
|
|
miniupnp Site Admin
Joined: 14 Apr 2007 Posts: 1593
|
Posted: Fri Apr 25, 2008 6:26 pm Post subject: |
|
|
miniupnp wrote: | * TCP stuff on port 2869 is used by Windows for UPnP event notifications. miniupnpd still doesnt manage the event notifications. |
version 1.1 does support event notifications ! _________________ Main miniUPnP author.
https://miniupnp.tuxfamily.org/ |
|
Back to top |
|
|
|