Skip to content

← network package

TCPOutput

Output data via TCP.

This node can act either as a TCP client or a TCP server. Supports various kinds of message encodings and encoded content. More Info... Version 2.0.1

Ports/Properties

data

Data to send.

verbose name
Data
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
IN

role

Connection role. If set to client, then this node will actively connect to the given host/port where the other process is expected to be listening. If set to server, then this node will bind on the given port and IP address and listen for incoming connections.

verbose name
Client/server Role
default value
client
port type
EnumPort
value type
str (can be None)

host

Hostname or IP address to use. In client mode, this identifies host to which to connect (e.g., 127.0.0.1 for local machine). In server mode, this node will bind on this IP address, which restricts from where incoming connections are accepted (127.0.0.1 restricts to connections from the same machine, and 0.0.0.0 allows incoming connections from anywhere).

verbose name
Tcp Hostname/ip
default value
127.0.0.1
port type
StringPort
value type
str (can be None)

portnum

TCP port to use. In client mode, this will connect to a (possibly remote) service listening on this port. In server mode, this node will itself listen on this port for connections.

verbose name
Tcp Port
default value
57318
port type
IntPort
value type
int (can be None)

encoding

Encoding format to use. CSV is the simplest one but only supports a flat 1d array per message. Lines emits a custom text line and also only supports 1d arrays (sample content). The other formats are fully general. JSON is human-readable, universally supported, and easy to parse, msgpack is binary and quite efficient (also commonly supported), yaml is human-readable and quite commonly supported, and pickle is binary and quite python-specific.

verbose name
Message Encoding
default value
csv
port type
EnumPort
value type
str (can be None)

content

Data content to transmit per message. The sample is the simplest one and contains just an array of channel values. Sample+ts includes the time-stamp as the last value. Ndarray is the n-way array for a given block. This only supports a single applicable stream in the data. Block is that plus axis descriptions. Chunk is a block plus meta-data. Packet is a dictionary/mapping of multiple named chunks.

verbose name
Content To Send
default value
sample
port type
EnumPort
value type
str (can be None)

lines_format

Format string for the lines content. The typical usage would be to use as many format specifiers as you have channels in your signal. The example is for a single-channel output signal.

verbose name
Lines Format
default value
%.3f
port type
StringPort
value type
str (can be None)

subset

Subset of chunks to consider for transmission.

verbose name
Stream Subset To Send
default value
both
port type
EnumPort
value type
str (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)