close

xod-dev/w5500/close

Closes an open TCP connection
close
@/close
Closes an open TCP connection
INET@/w5500-inet
An internet connection
SOCKxod/net/socket
The socket
CLSpulse
Close the connection
close
INET'
DONE
INET
SOCK
CLS
DONEpulse
Pulses when the connection is closed
INET'@/w5500-inet
An internet connection
To use the node in your project you should have the xod-dev/w5500 library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_CLS

#include <SPI.h>
#include <Ethernet2.h>

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

        auto client = EthernetClient(getValue<input_SOCK>(ctx));
        client.stop();
        emitValue<output_DONE>(ctx, 1);
        emitValue<output_INETU0027>(ctx, getValue<input_INET>(ctx));
    }
}