Skip to content

Getting Started documentation examples set TcpPort after OSCQueryHttpServer has already been created #46

@PeachBight

Description

@PeachBight

Cope snippets within getting-started.md currently use the fluent interface by calling WithDefaults() first before specifying ptjer details, such as WithTcpPort(tcpPort). However, WithDefaults() currently calls StartHttpServer(), so the subsequent WithTcpPort(tcpPort) does not affect the http server, and it still defaults to port 8060.

For example in A Simple Example:

var tcpPort = Extensions.GetAvailableTcpPort();
var udpPort = Extensions.GetAvailableUdpPort();

var oscQuery = new OSCQueryServiceBuilder()
    .WithDefaults()
    .WithTcpPort(tcpPort)
    .WithUdpPort(udpPort)
    .WithServiceName("MyService")
    .Build();

// Manually logging the ports to see them without a logger
Console.WriteLine($"Started OSCQueryService at TCP {tcpPort}, UDP {udpPort}");

// Stops the program from ending until a key is pressed
Console.ReadKey();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions