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/
TCP Network commands and Ports (Hole punching)
-
- Enthusiast
- Posts: 196
- Joined: Tue Sep 30, 2003 4:32 pm
- Location: The Netherlands
Yes, see the manual:
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.
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.
[ I did not check this but there is a server.pb (and clinet.pb) example]
Jan V.
Life goes to Fast, Enjoy!!
PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!
AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!
AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
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
*EDIT*
Looks like a lot has changed since version 3.98

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

Last edited by AndyMK on Fri Jul 14, 2006 5:23 pm, edited 2 times in total.
-
- Enthusiast
- Posts: 196
- Joined: Tue Sep 30, 2003 4:32 pm
- Location: The Netherlands
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...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
Jan V.
(any source from you're experiments in the near furure?)
Life goes to Fast, Enjoy!!
PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!
AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)
PB 4 is to good to be true, wake up man it is NOT a dream THIS is a reality!!!
AMD Athlon on 1.75G, 1Gb ram, 160Gb HD, NVidia FX5200, NEC ND-3500AG DVD+RW and CD+RW, in a Qbic EO3702A and Win XP Pro SP2 (registered)