NetTalk Central

Author Topic: Listen on several ports  (Read 3112 times)

Djordje Radovanovic

  • Full Member
  • ***
  • Posts: 237
    • View Profile
Listen on several ports
« on: March 18, 2022, 04:01:41 AM »
I'm building a server for acquiring and displaying data from IoT sensors. My problem is that IoT sensors are sending their data on different port than users who are browsing that acquired data. Users are accessing over port 80 and IoT sensors are using 10001 port.

How to do this with one application?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Listen on several ports
« Reply #1 on: March 22, 2022, 12:20:40 AM »
One approach;

You would make multiple WebServer procedures in the same application.
They can both use the same WebHandler procedure.

One of the web servers (the "human" one) would have the usual settings Tab but the other one should have "fixed" settings, and not use the Settings control template.

However I would go another way. I'd make a second WebServer app, ie a second Exe, which just has the procedures that the IoT devices will call. Talking to the same database, but a different program. Probably quite a small one if all it's doing is listening for a single data-collection endpoint.

Cheers
Bruce