TSDuck v3.45-4766
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::ReactiveTextStreamHandlerInterface Class Reference

Interface class for line-oriented Telnet-like connection Reactor handlers. More...

#include <tsReactiveTextStreamHandlerInterface.h>

Public Member Functions

virtual void handleTextLine (ReactiveTextStream &stream, const UString &line, int error_code, const ObjectPtr &user_data)
 Handle the reception of one text line.
 
virtual void handleWriteText (ReactiveTextStream &stream, const std::string &text, int error_code, const ObjectPtr &user_data)
 Handle the termination of a write operation.
 

Detailed Description

Interface class for line-oriented Telnet-like connection Reactor handlers.

With a ReactiveTCPConnection, an application shall use ReactiveTCPConnectionHandlerInterface for the non-line-oriented parts of the connection (connection, close, etc). All methods are empty by default. An application may implement the required ones only.

Member Function Documentation

◆ handleTextLine()

virtual void ts::ReactiveTextStreamHandlerInterface::handleTextLine ( ReactiveTextStream stream,
const UString line,
int  error_code,
const ObjectPtr user_data 
)
virtual

Handle the reception of one text line.

Parameters
[in,out]streamReactive stream for which the handler is invoked.
[in]lineReceived text line, without end-of-line markers.
[in]error_codeSystem-specific error code, including:
  • SYS_SUCCESS on success.
  • SYS_EOF on end of input or if the peer has disconnected,
  • SYS_ERROR in case of unknown error.
[in]user_dataThe user-data shared pointer which was passed to startReadText().

◆ handleWriteText()

virtual void ts::ReactiveTextStreamHandlerInterface::handleWriteText ( ReactiveTextStream stream,
const std::string &  text,
int  error_code,
const ObjectPtr user_data 
)
virtual

Handle the termination of a write operation.

Parameters
[in,out]streamReactive stream for which the handler is invoked.
[in]textSent text. This is the raw sent text, with embedded end-of-lines and UTF-8 translation of UString lines. When flush was set to false in some start-write operations, the text contains the concatenation of all previous unflushed operations.
[in]error_codeSystem-specific error code, including:
  • SYS_SUCCESS on success.
  • SYS_EOF if the handler is called as a completion of "close write" or "send EOF", whatever it means for the stream device.
  • SYS_CANCELED if the I/O was canceled before completion.
  • SYS_ERROR in case of unknown error.
[in]user_dataThe user-data shared pointer which was passed to startWriteLine() or startWriteText().

The documentation for this class was generated from the following file: