vibe.de multiple ports.
kozzi11 at gmail.com
Wed Sep 30 14:12:46 UTC 2020
On Wed, Sep 30, 2020 at 2:40 PM seany via Digitalmars-d-learn <
digitalmars-d-learn at puremagic.com> wrote:
> On Wednesday, 30 September 2020 at 12:29:06 UTC, Daniel Kozak
> to separate the messages from the IoT responses quickly and
> forward them to different programs, and to have the capability in
> hand, so that when later i have an idea to exploit the
> capability, I can also do it.
Ok as Adam said you can do something like this:
immutable ushort startPort = 5500;
import std.range : iota;
foreach (ushort port; iota!(ushort,ushort)(startPort, startPort + 100))
auto settings = new HTTPServerSettings;
settings.port = port;
settings.bindAddresses = ["::1", "127.0.0.1"];
void hello(HTTPServerRequest req, HTTPServerResponse res)
import std.conv : to;
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Digitalmars-d-learn