tcpout

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package tcpout contains the tcpOut node implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TCPOutConfig

type TCPOutConfig struct {
	// Beserver is the Node-RED mode selector: "client" keeps one
	// connection to host:port, "server" listens on port and writes
	// to every connected socket, "reply" answers the tcpIn session
	// that produced the message (or broadcasts to all pooled
	// sessions when the message has no ip/port metadata).
	Beserver string `json:"beserver"`
	// Host is the target host for client mode (default 127.0.0.1).
	Host string `json:"host"`
	// Port is the target port (client) or listen port (server).
	Port int `json:"port"`
	// End closes the connection after each write (client and server
	// modes — Node-RED's "close connection" checkbox).
	End bool `json:"end"`
	// Base64 decodes a base64 payload string before sending.
	Base64 bool `json:"base64"`
	// Reply is the legacy flag form of Beserver "reply"; ignored
	// when Beserver is set.
	Reply bool `json:"reply"`
	// TLS names a tlsConfig node in the same workflow; client-mode
	// dials are upgraded to TLS with that material.
	TLS string `json:"tls"`
}

TCPOutConfig holds configuration for the tcpOut node.

type TCPOutNode

type TCPOutNode struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

TCPOutNode writes the message Data over TCP — replying on the accepted connection(s) that produced the message (reply mode), holding a persistent connection to host:port (client mode) or broadcasting to every client of a socket it listens on (server mode).

func NewTCPOutNode

func NewTCPOutNode(node nodestore.NodeInterface, config *TCPOutConfig, host nodebase.NodeHost) *TCPOutNode

NewTCPOutNode creates a new tcpOut node

func (*TCPOutNode) Activate added in v0.7.0

func (n *TCPOutNode) Activate(ctx context.Context) error

Activate resolves the per-node state up front (so Stop can reach it without touching host state) and, in server mode, binds the listen socket the same way tcpIn does. Client-mode connections dial lazily on the first message so a missing server does not fail the deploy.

func (*TCPOutNode) Execute

Execute sends the payload's Data and returns the input unchanged.

func (*TCPOutNode) Stop added in v0.7.0

func (n *TCPOutNode) Stop() error

Stop shuts down the server listener / accepted sockets / client connection (idempotent).

func (*TCPOutNode) StopKey added in v0.7.0

func (n *TCPOutNode) StopKey() string

StopKey dedupes stopper registration across the per-message executor shells — they all share the one state object.

func (*TCPOutNode) Validate

func (n *TCPOutNode) Validate() error

Validate checks the tcpOut node configuration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL