-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
The WithDefaults() method actually activates http server and not change server name and ports configuration, while its name suggest "just set default values for later activation".
So, in current library, this code is wrong (this one is similar to the example code in Getting started Doc.):
var myBadService = new new OSCQueryServiceBuilder()
.WithDefaults() // At this time, a http server has been activated at default configuration.
// Methods below are only change class' property, and information in the server is not going to be changed.
.WithTcpPort(Extensions.GetAvailableTcpPort())
.WithUdpPort(Extensions.GetAvailableUdpPort())
.WithServiceName("MySuperDuperService")
.Build();
... and this is the version works fine:
var myGoodService = new OSCQueryServiceBuilder()
// First, modify class' properties.
.WithTcpPort(Extensions.GetAvailableTcpPort())
.WithUdpPort(Extensions.GetAvailableUdpPort())
.WithServiceName("MySuperDuperService")
// Then activate server with this function
.WithDefaults()
.Build();
knah, GotoFinal, cygami-vr, Myrkie and Natsumi-sama
Metadata
Metadata
Assignees
Labels
No labels