By Guest on Wednesday, 03 August 2022
Posted in General
Replies 2
Likes 0
Views 807
Votes 0
Is there any way to don't start a WebSocket server on a specific port but let it to find a free one??? (then I could get it through Port property or Bindings counterpart)
Hello,

Yes, just set Port to zero and the server will choose the first available port that finds.


TsgcWebSocketServer1.Port := 0;


You can know which is the Port selected accessing to the bindings property.


TsgcWebSocketServer1.Bindings.Items[0].Port;


Kind Regards,
Sergio
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
It worked like a charm!

Thanks
·
2 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post