0

I want to develop a solution that works like this:

An application server does some logic and outputs data. Multiple clients can connect to the server and all of them get the sama data (the data change with time). Simply put, the server works as a broadcast.

Here's a diagram:

enter image description here

Is it possible (and correct) to use just one port on the server, since all the ports are just duplicates?

enter image description here

The thing is, I want the clients to be sure they got the whole message before they do something else with it - so I need TCP, not UDP logic. I guess fusing the server ports into one is not an option then..? Thank you :)

Michal Hromas
  • 75
  • 1
  • 7
  • 1
    What makes you think you need multiple ports to handle multiple connections? Think about a typical http server, it can serve hundreds or even thousands of clients with one port (80) just fine. Even for persistent connections, take a mysql server for example, it can handle dozens if not hundreds connections just fine. – Rico Chen May 27 '18 at 20:56
  • Well, the thing is, I haven't developed any client-server application before, so I have some gaps in knowledge regarding it. But aren't ports the ends of the connections? Meaning the server won't be able to handle all the client simultaneously? – Michal Hromas May 27 '18 at 21:02
  • 1
    See https://stackoverflow.com/questions/3329641/how-do-multiple-clients-connect-simultaneously-to-one-port-say-80-on-a-server – Rico Chen May 27 '18 at 21:10
  • @RicoChen ok, thanks :) – Michal Hromas May 27 '18 at 21:56

0 Answers0