Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

System.Net.Sockets.SocketException #9

@c4tgrl

Description

@c4tgrl

SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted.

Code:
Variable private Webserver _webserver;

Constructor:
_webserver = new Webserver("localhost", 8000, IndexHtml); _webserver.Start();

My IndexHtml method:
private async Task IndexHtml(HttpContext ctx) { string data = Resources.Load<TextAsset>("OptionsWeb/index.html").text; ctx.Response.ContentLength = data.Length; ctx.Response.ContentType = "text/html"; ctx.Response.StatusCode = 200; await ctx.Response.SendAsync(data); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions