Simple multithreaded webserver for Netduino. Lets user register endpoints that can be called on the server. When the server receives a valid command, it fires the EndPointReceived event with details stored in the EndPoinEventArgs parameter. Modifications By: Kjetil Seim Haugen Contact: [email protected] Latest revision: sometime 2016 Modifications By: Anton Kropp Contact: [email protected] Latest revision: 28 november 2012 Original Author: Jasper Schuurmans Contact: [email protected] Latest revision: 06 april 2011
예제 #1
0
    /// <summary>
    /// Start listening on the port and enable any registered callbacks
    /// </summary>
    /// <param name="port"></param>
    /// <param name="enabledLedStatus"></param>
    public static void StartWebServer(int port = 80, bool enabledLedStatus = true)
    {
        _server = new WebServer(port, enabledLedStatus);

        _server.EndPointReceived += EndPointHandler;

        foreach (EndPoint endpoint in _endPoints)
        {
            _server.RegisterEndPoint(endpoint);
        }
            

        // Initialize the server.
        _server.Start();
    }