To bind a server to multiple ports, you’ll need separate Socket instances for each port since a single socket instance can only bind to one specific IP address and port combination.
Instead of having a single listener socket, you can create a list or dictionary of Socket instances, with each socket bound to a different port. For each port, create a new socket, bind it to the desired IP and port, and begin accepting connections.