IPeekableContentProvider¶
The IPeekableContentProvider interface defines an abstraction for providing content to an IContentConsumer with the ability to peek at the content without consuming it. It is an essential part of content streaming over a TCP connection.
Remarks:
Key Functions of IPeekableContentProvider:
- Content Provision: It provides content to an associated IContentConsumer without immediately consuming the content. This allows the consumer to examine the data before processing.
- Two-Way Binding: Supports establishing a two-way binding between the IPeekableContentProvider and an IContentConsumer, enabling bidirectional communication between the provider and consumer.
- Unbinding: Provides methods for unbinding a content consumer, terminating the association between the provider and consumer.
Fields:¶
PeekableContentProviderStream Peekable¶
- Gets the PeekableContentProviderStream associated with this content provider, which allows peeking at the content without consuming it.
IContentConsumer Consumer¶
- Gets the IContentConsumer implementor that will be notified through OnContent calls when new data is available in the TCPStreamer.
Methods:¶
Void SetTwoWayBinding(IContentConsumer)¶
- Sets up a two-way binding between this content provider and an IContentConsumer. This enables bidirectional communication between the provider and consumer.
Void Unbind()¶
- Unbinds the content provider from its associated content consumer. This terminates the association between the provider and consumer.
Void UnbindIf(IContentConsumer)¶
- Unbinds the content provider from a specific content consumer if it is currently bound to that consumer.