Skip to content

b26056c7 12c6 1dd1 27b8 be08f2dd18eb

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

Publisher Class

Describes a pack publisher, which will be responsible for managing the incoming packs, adding them in a packQueue and by setting an incomingPackEvent to signal to the Consume() that there is a packet in the queue.

Inheritance Hierarchy

System.Object
  NETLIB.Publisher
    NETLIB.TCP.TCPPublisher
Namespace: NETLIB
Assembly: NETLIB (in NETLIB.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#

public abstract class Publisher : IDisposable

VB

Public MustInherit Class Publisher
	Implements IDisposable

C++

public ref class Publisher abstract : IDisposable

F#

[<AbstractClassAttribute>]
type Publisher =  
    class
        interface IDisposable
    end

The Publisher type exposes the following members.

Constructors

 

Name Description
Public method Publisher Initializes the input event, the queue of packages and the states of the publisher.
  Back to Top

Properties

 

Name Description
Public property IncomingPackEvent Event signaling that a packet arrived.
Public property IsAlive Boolean indicating whether the stream is still alive and able to receive new packages.
Public property IsEnabled Boolean indicating whether the publisher is currently active, publishing packages.
Public property PackQueue Gets the pack queue
  Back to Top

Methods

 

Name Description
Public method CloseConnection Stop listening packets, closes the stream and reset the properties of the publisher
Public method Dispose Closes the connection, and resets the states of the publisher.
Public method Equals Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected method Finalize Release resources 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 OnConnectionClosedCall Calls ConnectionClosedEvent
Protected method Publish Method responsible for receiving packets of stream and puts them in the packet queue and signal the incoming pack event.
Public method SendPack(Byte[], IPEndPoint) Sends the packet through the same stream that is receiving packets.
Public method SendPack(BasePack, IPEndPoint) Sends the packet through the same stream that is receiving packets.
Public method Start Starts the packages listening/receive thread.
Public method Stop Stops the packages listening/receive thread.
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.
  Back to Top

Fields

 

Name Description
Protected field incomingPackEvent Event signaling that a packet arrived.
Protected field isAlive Boolean indicating whether the stream is still alive and able to receive new packages.
Protected field isEnabled Boolean indicating whether the publisher is currently active, publishing packages.
Protected field packQueue Queue that stores incoming packets.
Protected field publisherThread Thread that will run the reception and publication of packs.
  Back to Top

See Also

Reference

NETLIB Namespace
NETLIB.BasePack
NETLIB.Consumer(TPack)

Clone this wiki locally