0

enter image description here

i want to listen multiple different tcp ports on single tcp server(i do not want to create multiple tcp servers).

I searched and found something similar here(for Java and .Net) Java Server - Multiple ports? https://social.msdn.microsoft.com/Forums/vstudio/en-US/09828be4-6ac4-45ec-a116-508314dab793/listen-on-multiple-ports?forum=csharpgeneral

how can i do that in nodejs?

thank you.

  • this should help https://stackoverflow.com/questions/19296797/running-node-js-http-server-on-multiple-ports – shakir ullah Oct 02 '20 at 04:49
  • @shakirullah that sets up multiple tcp/http servers – Matt Oct 02 '20 at 04:51
  • @Free.Wong Can you explain your use case? node net servers only listen on a single port but you may be able to handle sockets like shakirullah suggested – Matt Oct 02 '20 at 04:56
  • What is the point of having different clients connect on different ports to the same server? The whole point of a server is that it can allow multiple clients to connect to a single server on a single port. – jfriend00 Oct 02 '20 at 05:20

0 Answers0