miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question about the code.

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> NAT/UPnP
View previous topic :: View next topic  
Author Message
ramytabet



Joined: 14 May 2007
Posts: 12

PostPosted: Wed May 16, 2007 3:19 pm    Post subject: Question about the code. Reply with quote

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
View user's profile Send private message
ramytabet



Joined: 14 May 2007
Posts: 12

PostPosted: Thu May 17, 2007 11:22 am    Post subject: Solved ! Reply with quote

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
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1412

PostPosted: Fri May 18, 2007 9:26 pm    Post subject: Reply with quote

* 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
View user's profile Send private message Visit poster's website
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1412

PostPosted: Fri Apr 25, 2008 6:26 pm    Post subject: Reply with quote

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.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> NAT/UPnP All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.