Client server communication with Winsock
I am building a client server application using Winsock control.
Based on that I have the following code part on server side which try to
connect to the first based port and if not scan to the next free on on a
range of 10:
For iPortNumber = ServerInfo.ListenPort To ServerInfo.ListenPort + 10
tcp.LocalPort = iPortNumber
On Error Resume Next
tcp.Listen ' If we get an error, the port is busy.
If Err.Number = 10048 Then ' port is busy
ServerInfo.ListenPort = iPortNumber
ServerInfo.bRunning = True
What happen next is that the client side application need to know what is
the communication port that has been selected by the server.
Is there a way that the server informed about the client about that port
For the client side, it used the based port number but as the server has
notify that it was used then the client point to the wrong port tio initiate
Thansk for your help
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center