Skip to content

ad2435fb b776 6a2f 4e05 257d143d1edb

Arthur Frederico Neves edited this page Jul 19, 2016 · 6 revisions

Consumer(TPack) Class

Describes the class that will be responsible for consuming the packages, meaning it will build packages with the buffers published by a publisher and will launch an event for every pack to be treated.

Inheritance Hierarchy

System.Object
  NETLIB.Consumer(TPack)
    NETLIB.IOPackHandler(TPack)
Namespace: NETLIB
Assembly: NETLIB (in NETLIB.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#

public abstract class Consumer<TPack> : IDisposable
where TPack : BasePack

VB

Public MustInherit Class Consumer(Of TPack As BasePack)
	Implements IDisposable

C++

generic<typename TPack>
where TPack : BasePack
public ref class Consumer abstract : IDisposable

F#

[<AbstractClassAttribute>]
type Consumer<'TPack when 'TPack : BasePack> =  
    class
        interface IDisposable
    end

Type Parameters

 

TPack
Pack class derived from BasePack that the Consumer will manage.
  The Consumer(TPack) type exposes the following members.

Constructors

 

Name Description
Public method Consumer(TPack) Initializes the consumer with a publisher and define the initial settings.
  Back to Top

Properties

 

Name Description
Public property IsEnabled Boolean indicating when the consumption of packages is active.
Public property IsPublishEnabled Boolean indicating whether the publisher is currently active, publishing packages.
Public property Publisher Returns the publisher being consumed.
  Back to Top

Methods

 

Name Description
Public method CloseConnection Closes the publisher connection.
Public method Dispose Ends the consumption of paks without changing the status of the publisher.
Public method EndConsume Stops the pack consumption thread.
Public method EndPublishConsume Stops the publisher and the pack consumption thread.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Ends the consumption of paks without changing the status of the publisher, in the death of the object, if the Dispose method was not used properly. (Overrides Object.Finalize().)
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Protected method OnReceivedPackCall Calls ReceivedPack for treatment and consumption of a incoming package.
Public method PackFactory() Used by the Consume() to obtain an instance of the TPack through BasePack() constructor.
Public method PackFactory(Byte[]) Used by the Consume() to obtain an instance of the TPack through BasePack(Byte[]) constructor.
Public method PackFactory(BasePack) Used by the Consume() to obtain an instance of the TPack through BasePack(BasePack) constructor.
Public method SendPack(Byte[], IPEndPoint) Sends the packet through the publisher
Public method SendPack(TPack, IPEndPoint) Sends the packet through the publisher
Public method Start Starts the publisher and the thread of consumption of packs.
Public method StartConsume Starts the thread of consumption of packs.
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
  Back to Top

Events

 

Name Description
Public event ConnectionClosed Event used to signal when the connection (input stream) was closed for any reason.
Public event ReceivedPack Event called for treatment and consumption of a incoming pack.
  Back to Top

See Also

Reference

NETLIB Namespace
NETLIB.BasePack
NETLIB.Publisher
NETLIB.ThrowPackEventHandler(TPack)

Clone this wiki locally