How to assign static port to TCp server clients #141
Replies: 2 comments 13 replies
-
Hi @nirajgenius thanks for your note. The library doesn't support that today, but the underlying Note that I don't know if there are multiplatform implications, i.e. it works on Windows but not on Mac. I haven't tested it. Out of curiosity, why would you want to make the client port static? Generally by definition a client port is random, above 1024, and not something you should want to persist. Please let me know more about the use case if you have some time; there might be an easy way to incorporate this into WatsonTcp without disturbing the codebase too much, but I want to make sure it's inline with the intent of the library. Cheers, Joel |
Beta Was this translation helpful? Give feedback.
-
Hello Joel, Thank you for your reply. We have Serial to WiFi ethernet Wireless devices that will be considered as clients and by using the Watson TCP library I build a server as you saw in the above screenshot. So far I am able to connect multiple clients but the problem is how to identify who is which client? how to make sure if I want to communicate to a specific client? I was thinking IP address but in my case, the client can be multiple in the same network so they will have the same IP so IP: PORT is what I think we can identify the unique client. can you suggest how to identify clients? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello Joel,
How can we make sure when the client gets connected then it uses the static port.


When I say static means once the client first time joined with the server then always assigned that same port one future connections.
Please see my screenshot below. I have the same client connected two times and each time It's assigned a different port.
Beta Was this translation helpful? Give feedback.
All reactions