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
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL