Using winsock you define what port your using, how many ports are there? I know there is over 1000 because I usually use 1000, 1001, and 1002.
Printable View
Using winsock you define what port your using, how many ports are there? I know there is over 1000 because I usually use 1000, 1001, and 1002.
If memory serves me right, port numbers are a 16 bit number so there are 2^16 ports available or 65536. Port 1 - 1024 are for assigned for specific standard protocols such as http, ftp, pop and so on. 1024 and up are free to use.
Yeah there are 256 * 256 = 0xFFFF (or FFFFh if you will) ports.
You are totally correct, noone. In English, there are 65536 ports, or maybe just 65535 ... I am not sure. What is port 0 used for??? :-)
So I might be getting errors while online becuase Im using prot 1000 for my game? Do you think I should change it to like 2000 or something?Quote:
Originally posted by noone
Port 1 - 1024 are for assigned for specific standard protocols such as http, ftp, pop and so on. 1024 and up are free to use.
It would probably be a good idea to use something above 1024 for your game, but I dont think it's totally essential. Certain operating systems (like some flavours of Unix) will require you to have special permissions before you run a program that listens to a port below 1024, but I dont think Windows will do that. Port 1000 is probably unnasigned, but sometime in te future, it may be assigned to some protocol.
Port 0 is ICMP.