close

xod/esp8266/close

Closes an open TCP connection
close
@/close
Closes an open TCP connection
SOCKxod/net/socket
A socket
INET@/esp8266-inet
An internet connection
CLSpulse
Close the connection
close
SOCK
INET
CLS
DONE
ERR
ERRpulse
Pulses when error occured
DONEpulse
Pulses when the connection is closed

C++ implementation

struct State {
};

// clang-format off
{{ GENERATED_CODE }}
// clang-format on

void evaluate(Context ctx) {
    if (!isInputDirty<input_CLS>(ctx))
        return;

    auto inet = getValue<input_INET>(ctx);

    if (inet.wifi->releaseTCP()) {
        emitValue<output_DONE>(ctx, 1);
    } else {
        emitValue<output_ERR>(ctx, 1);
    }
}