Skip to content

bdd455da b4b3 b9a6 9e5d c3d5ad755994

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

IOPackHandler(TPack) Class

Better manage the incoming and outgoing TPack using a Protocol(TPack) to redistribute the packs. It has an internal dictionary of Protocol(TPack) that can be exchanged for the currently used.

Inheritance Hierarchy

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

Syntax

C#

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

VB

Public MustInherit Class IOPackHandler(Of TPack As BasePack)
	Inherits Consumer(Of TPack)

C++

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

F#

[<AbstractClassAttribute>]
type IOPackHandler<'TPack when 'TPack : BasePack> =  
    class
        inherit Consumer<'TPack>
    end

Type Parameters

 

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

Constructors

 

Name Description
Public method IOPackHandler(TPack) Initializes the handler with a publisher who will publish the packages and a protocol that will be used initially by this connection.
  Back to Top

Properties

 

Name Description
Public property CurrentProtocolName Name of the current protocol.
Public property IsEnabled Boolean indicating when the consumption of packages is active. (Inherited from Consumer(TPack).)
Public property IsPublishEnabled Boolean indicating whether the publisher is currently active, publishing packages. (Inherited from Consumer(TPack).)
Public property Publisher Returns the publisher being consumed. (Inherited from Consumer(TPack).)
  Back to Top

Methods

 

Name Description
Public method AddProtocol Add a new protocol in the protocols dictionary.
Public method CloseConnection Closes the publisher connection. (Inherited from Consumer(TPack).)
Public method Dispose Ends the consumption of paks without changing the status of the publisher. (Inherited from Consumer(TPack).)
Public method EndConsume Stops the pack consumption thread. (Inherited from Consumer(TPack).)
Public method EndPublishConsume Stops the publisher and the pack consumption thread. (Inherited from Consumer(TPack).)
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method ExchangeProtocol Change the current protocol for one stored in the dictionary.
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. (Inherited from Consumer(TPack).)
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

(Overrides Consumer(TPack).OnReceivedPackCall(TPack).)

Public method PackFactory() Used by the Consume() to obtain an instance of the TPack through BasePack() constructor. (Inherited from Consumer(TPack).)
Public method PackFactory(Byte[]) Used by the Consume() to obtain an instance of the TPack through BasePack(Byte[]) constructor. (Inherited from Consumer(TPack).)
Public method PackFactory(BasePack) Used by the Consume() to obtain an instance of the TPack through BasePack(BasePack) constructor. (Inherited from Consumer(TPack).)
Public method SendPack(Byte[], IPEndPoint) Sends the packet through the publisher (Inherited from Consumer(TPack).)
Public method SendPack(TPack, IPEndPoint) Sends the packet through the publisher (Inherited from Consumer(TPack).)
Public method Start Starts the publisher and the thread of consumption of packs. (Inherited from Consumer(TPack).)
Public method StartConsume Starts the thread of consumption of packs. (Inherited from Consumer(TPack).)
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. (Inherited from Consumer(TPack).)
Public event ReceivedPack Event called for treatment and consumption of a incoming pack. (Inherited from Consumer(TPack).)
  Back to Top

See Also

Reference

NETLIB Namespace

Clone this wiki locally