I first wount to say that this site is GOOD for all the people who don't know mutch about VB.
I'm very happy with you all :o
I've search with google to a help me with my problem and found this site/forum. :D
So here comes my problem and i hope someone gives me the light :mrgreen: .
(I'm jusing VB 6).
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.
I tryed it with the next code , but with no succes :confused:
Private Sub Form_Load() 'Winsock closed Winsock1.Close 'Open ip from server in text7.text Winsock1.RemoteHost = Text7.Text 'Open new port for server in text8.text Winsock1.RemotePort = Text8.Text 'make contact Winsock1.Connect 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 end sub
What's wrong in my code or what must i do so to lets search the game if the port is in use and switch with the ports??
Edited 3 Years Ago by diafol: fixed formatting