I've made a Game and a server program. The server program only let you see whats the game sending to it. I opend in the server 3 ports, example 21, 22, 23. Now i have, that the game sends all his information on port 21. But when i want to open the game again (what i mean is i open it twice) then the first game will listen on port 21 but the other game is not responding.
So my quostion is next>>> Is there a possibility that the game checks is port 21 is in juse, so yes jump then to port 22?? So that both games works, one on port 21 and teh second game on port 22 or visa versa.
First of all, will your server listen on the three ports (21, 22, 23) for distinct purposes, or you want to be able to control three distinct connections?
It seems it's the second one. Anyways, if you plan to accept multiple connections in the server (even if they come from the same host), you should make sure the port(s) known by the clients are *always* open and not in use.
That's done by using a winsock control array. Make the first item listen to some port as usual. On connection requests, make another available* item to accept the request id, and voila, all clients can connect to the same port!
*I mean, one whose state is not "connected".
If Winsock1.RemotePort = Not 21 Then
Winsock1.RemotePort = 22
End If
If Winsock1.RemotePort = Not 22 Then
Winsock1.RemotePort = 23
End If
If Winsock1.RemotePort = Not 23 Then
Winsock1.RemotePort = 21
End If
Only FYI, check what you are doing there. "Not 21" is -22. :rolleyes: