Operator V1TCPSink
SPL standard and specialized toolkits > spl 1.4.0 > spl.compat > V1TCPSink
The V1TCPSink operator writes binary data to a TCP socket that is connected to an InfoSphere Streams Version 1.2 TCP Source operator. It can be configured as a TCP server, which listens for a client connection, or as a TCP client, which initiates a connection to a server. In both modes, it handles a single connection at a time.
The V1TCPSink operator works with both IPv4 and IPv6 addresses. The corresponding Version 1.2 V1TCPSource operator must have a binFormat modifier to send the data in binary format. The V1TCPSink operator is defined in the spl.compat namespace and must be included through a use spl.compat::V1TCPSink; statement.
Exceptions
- The host cannot be resolved.
Examples
This example uses the V1TCPSink operator.
composite Main {
graph
stream<rstring name, int32 age, int32 salary> A = Beacon() {}
// Send the tuple out to an InfoSphere Streams V1.2 system
() as Nil = spl.compat::V1TCPSink(A)
{
param
address : "localhost";
port : 4001u;
role : client;
flush : 1u;
}
}
The following example contains the corresponding V1.2 TCP Sink:
Nil := Sink(A) ["ctcp://thishost:4000/", binFormat] {}
Summary
- Ports
- This operator has 1 input port and 0 output ports.
- Windowing
- This operator does not accept any windowing configurations.
- Parameters
- This operator supports 7 parameters.
Required: role
Optional: address, flush, port, reconnectionBound, reconnectionPolicy, sendBufferSize
- Metrics
- This operator reports 1 metric.
Properties
- Implementation
- C++
- Threading
- Always - Operator always provides a single threaded execution context.
- Ports (0)
-
The V1TCPSink operator is configurable with a single input port, which ingests tuples to be written over a TCP connection to a V1.x system. The tuple that is accepted by the V1TCPSink operator must contain attributes of supported SPL types only.
- Properties
-
- Optional: false
- ControlPort: false
- TupleMutationAllowed: false
- WindowingMode: NonWindowed
- WindowPunctuationInputMode: Oblivious
Required: role
Optional: address, flush, port, reconnectionBound, reconnectionPolicy, sendBufferSize
- address
-
Specifies the destination address of the TCP connection in client mode. For more information, see the address parameter in the V1TCPSource operator.
- Properties
-
- Type: rstring
- Cardinality: 1
- Optional: true
- ExpressionMode: AttributeFree
- flush
-
Specifies the number of tuples after which to flush the output. For more information, see the flush parameter in the spl.adapter::FileSink operator.
- Properties
-
- Type: uint32
- Cardinality: 1
- Optional: true
- ExpressionMode: Constant
- port
-
Specifies the listening port address in server mode or the destination port address in client mode. For more information, see the port parameter in the V1TCPSource operator.
- Properties
-
- Cardinality: 1
- Optional: true
- ExpressionMode: AttributeFree
- reconnectionBound
-
Specifies the number of successive connections that will be accepted in server mode or attempted in client mode. For more information, see the reconnectionBound parameter in the V1TCPSource operator.
- Properties
-
- Type: uint32
- Cardinality: 1
- Optional: true
- ExpressionMode: AttributeFree
- reconnectionPolicy
-
In server mode, this parameter specifies whether more connections are allowed when the initial connection terminates. In client mode, this parameter specifies whether more connection attempts are made once the initial connection to the server terminates. For more information, see the reconnectionPolicty parameter in the V1TCPSource operator.
- Properties
-
- Type: ReconnectionPolicy (InfiniteRetry, NoRetry, BoundedRetry)
- Cardinality: 1
- Optional: true
- ExpressionMode: CustomLiteral
- role
-
Specifies whether the operator acts as a TCP server or client. For more information, see the role parameter in the V1TCPSource operator.
- Properties
-
- Type: SocketRole (server, client)
- Cardinality: 1
- Optional: false
- ExpressionMode: CustomLiteral
- sendBufferSize
-
Specifies the kernel send buffer size for the TCP socket.
- Properties
-
- Type: uint32
- Cardinality: 1
- Optional: true
- ExpressionMode: AttributeFree
- spl-std-tk-lib