Skip to content
Arthur Frederico Neves edited this page Jul 19, 2016 · 7 revisions

NETLIB Namespace

Namespace that contains the basic tools for creation and use of network managers and package managers

Classes

 

Class Description
Public classCode example BasePack Is the basic unit of the network communication, in other words all the information that travels over the network is converted in BasePack before transmission and is subsequently reassembled by the receiver. It simplifies operations with the network buffer and handle reading and writing.
Public class ConnectionClosedException Throws when trying to start a Publisher with a closed stream.
Public class Consumer(TPack) 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.
Public class ConsumerRunningException Throws when trying to start a Consumer(TPack) that is already running.
Public classCode example IOBasePackHandler Better manage the incoming and outgoing BasePack using a Protocol(TPack) to redistribute the packs. It has an internal dictionary of Protocol(TPack) that can be exchanged for the currently used.
Public class IOPackHandler(TPack) 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.
Public class ListenerRunnigException Throws when trying to start a TCPListenerHandler that is already running.
Public classCode example Protocol(TPack) Responsible for managing a communication protocol, in other words, analyze an incoming packet, check for a method of treatment registered for that type of package, if any, the method is called to handle the package, if not a generic event is called to handle the incoming pack. Idealised to facilitate handling packages and management protocols, especially in cases where the client continuously migrates between different protocols.
Public class Publisher 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.
Public class PublisherRunnigException Throws when trying to start a Publisher that is already running.

Interfaces

 

Interface Description
Public interfaceCode example IPackable Interface which describes the methods for packing and unpacking the calling Class in a package called BasePack. Use when you want to send/receive the class on the network. This interface describe the necessary methods that allow the class insert itself in a BasePack. Used by BasePack to insert a custom class in the buffer

Delegates

 

Delegate Description
Public delegate ConnectionClosedEventHandler Delegate used by the event ConnectionClosed to encapsulete a method that will be called when the connection close.
Public delegate ConnectionClosedEventHandler(Type) Delegate used by the event ConnectionClosed to encapsulete a method that will be called when the connection close.
Public delegate ThrowPackEventHandler(TPack) Delegate used to encapsulate a method tha will be called when a package is consumed.
 
Clone this wiki locally