<commit_before>#import "MDNS.h"

#define HTTP_PORT 80

MDNS mdns;

String html = "<html><body><h1>Ok!</h1></body></html>";

TCPServer server = TCPServer(HTTP_PORT);

void setup() {
    bool success = mdns.setHostname("core-1");

    if (success) {
        success = mdns.setService("_http._tcp", HTTP_PORT, "Core 1");
    }

    if (success) {
        success = mdns.addTXTEntry("coreid", "1");
    }

    if (success) {
        success = mdns.begin();
    }

    if (success) {
        Spark.publish("mdns/setup", "success");
    } else {
        Spark.publish("mdns/setup", "error");
    }
}

void loop() {
    mdns.processQueries();

    TCPClient client = server.available();

    if (client){
        client.println(html);
        client.println();
        client.flush();
        client.stop();
    }
}<commit_msg>Updated example.<commit_after>// This #include statement was automatically added by the Spark IDE.
#include "MDNS.h"

#define HTTP_PORT 80

MDNS mdns;

TCPServer server = TCPServer(HTTP_PORT);

void setup() {
    server.begin();

    bool success = mdns.setHostname("core-1");

    if (success) {
        success = mdns.setService("tcp", "http", HTTP_PORT, "Core 1");
    }

    if (success) {
        success = mdns.addTXTEntry("coreid", "1");
    }

    if (success) {
        success = mdns.begin();
    }

    if (success) {
        Spark.publish("mdns/setup", "success");
    } else {
        Spark.publish("mdns/setup", "error");
    }
}

void loop() {
    mdns.processQueries();

    TCPClient client = server.available();

    if (client){
        client.println("<html><body><h1>Ok!</h1></body></html>\n\n");
        client.flush();
        client.stop();
    }
}
{'fraction_non_alphanumeric': 0.1731678486997636, 'fraction_numerical': 0.008274231678486997, 'mean_word_length': 2.534446764091858, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7360374', 'n_tokens_mistral': 589, 'n_tokens_neox': 572, 'n_words': 116}