Page 1 of 1
TCP Network commands and Ports (Hole punching)
Posted: Fri Jul 14, 2006 1:22 pm
by AndyMK
Hi all, I have had a lot of experience with Blitz using its UDP functions to traverse NAT compliant routers without the need to open ports. Anyone who knows about "UDP Hole Punching" will agree it makes life much easier for a client using your network app behind a router. This process is also possible with TCP/IP in much the same way. After looking at the available TCP commands in the 3.98 online manual, my question is, can a Purebasic written server know the clients port number when a client connects? This is an essential part of holepunching. Here is a link for anyone interested in this process.
http://www.brynosaurus.com/pub/net/p2pnat/
Posted: Fri Jul 14, 2006 2:35 pm
by Jan Vooijs
Yes, see the manual:
Code: Select all
Port = GetClientPort(Client)
Description
This command should be called after EventClient() and will return the port of the client. The GetClientIP() command is available to get the client IP address.
And see EventClient() where it is stated that it is used on the Server side.
[ I did not check this but there is a server.pb (and clinet.pb) example]
Jan V.
Posted: Fri Jul 14, 2006 2:57 pm
by AndyMK
Im at work looking through the command index and the command is not there. Are there many more commands missing from the online documentation?
*EDIT*
Looks like a lot has changed since version 3.98

3.94 sorry
I just looked in my help files and sure enough its there

Posted: Fri Jul 14, 2006 4:20 pm
by Jan Vooijs
AndyMK wrote:Im at work looking through the command index and the command is not there. Are there many more commands missing from the online documentation?
*EDIT*
Looks like a lot has changed since version 3.98

And I am at home. Oops did not check for versions BEFORE PB4.0, but i thought it was in there since at least 3.94. I do not have 3.94 on my system so i can not check...
Jan V.
(any source from you're experiments in the near furure?)
Posted: Sat Jul 18, 2009 9:02 am
by Joel
Has you released your projekt. I´m Interested on the Source Code...