ITCPStreamerContentConsumer¶
The ITCPStreamerContentConsumer interface represents a specialized content consumer for use with TCPStreamer. It offers methods for writing data to the streamer and handling content-related events.
Remarks:
Key Functions of ITCPStreamerContentConsumer:
- Data Writing: Provides methods to write data to the associated TCPStreamer instance, allowing content to be sent over the TCP connection.
- Content Handling: Defines event methods for notifying consumers when new content is available, the connection is closed, or errors occur during data transfer.
Methods:¶
Write(Byte[], Int32, Int32)¶
- Writes the specified data buffer to the associated TCPStreamer instance. The data is copied into a new buffer and passed to the streamer for transmission.
Void Write(BufferSegment)¶
- Writes the specified BufferSegment directly to the associated TCPStreamer instance. The content of the buffer is passed to the streamer for transmission, and the ownership of the buffer is transferred to the TCPStreamer too.
Void OnContent(TCPStreamer)¶
- Called when new content is available from the associated TCPStreamer instance.
Void OnConnectionClosed(TCPStreamer)¶
- Called when the connection is closed by the remote peer. It notifies the content consumer about the connection closure.
Void OnError(TCPStreamer, Exception)¶
- Called when an error occurs during content processing or connection handling. It provides the TCPStreamer instance and the Exception that caused the error.