Click or drag to resize

Protocol Class

Base class for all protocols
Inheritance Hierarchy

Namespace:  Crosser.Server.Modules.Protocol
Assembly:  Crosser.Server (in Crosser.Server.dll) Version: 0.0.5
Syntax
C#
public abstract class Protocol : IProtocol, 
	IDisposable

The Protocol type exposes the following members.

Constructors
  NameDescription
Public methodProtocol
Ctor
Top
Properties
  NameDescription
Protected propertyAuthRequired
True if the IBaseEndpoint requires authentication
Public propertyClientStats
Clients statistics
Public propertyConnectionContext
Connection information IConnectionContext
Public propertyControllers
The controller instances used by this connection
Public propertyProtocolIdentifier
Identifier for the protocol, passed into the ctor from implementing protocols
Protected propertyPubSubHandler
Public propertyServer
Reference to the IServer
Public propertySubscriptions
Current subscriptions for this connection
Public propertyTransport
IBaseTransport for the protocol
Top
Methods
  NameDescription
Public methodDispose
Clean up the usage of controllers for the connection
Protected methodEnsureController
Makes sure that there is an instance of a specific controller. Also makes sure that security is in place. Knowing what methods the connection can call.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodExecuteCall
Invoke the correct RPC controller/method with the payload. Also handles return values when needed
Protected methodExecuteCallSynchronously
Invoke the correct RPC controller/method with the payload. Also handles return values when needed Will execute 1 operation at the time. Other operations will wait. This will be executed when the IController or the method being invoked is decorated with the RunSynchronouslyAttribute
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFlushTransport
Flushes the IBaseTransport write stream
Protected methodGetControllerDelegate
Creates a ControllerDelegate to use when calling the controller/method
Protected methodGetDeadConnectionFrame
Sent to clients when ping has failed more times than allowed
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Protected methodGetPingFrame
Each protocol is responsible for returning a valid ping frame for that protocol
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodHasControllerInstanceOf
True if the controllers repository has a instance of the specific BinaryKey
Protected methodInitClientStats
Setup the properties on the ClientStats object
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodReadLoop
Each protocol should implement a read loop
Public methodRemoveController
Removes a controller instance from the Controllers repository.
Public methodSend(Byte)
Enqueue the data to send and update the IServerStatistics
Public methodSend(BinaryKey, String, Byte)
Each protocol is responsible for building the message to send
Protected methodSend(Byte, Byte, Byte, Byte)
Public methodSendLoop
Send loop that reads the OutQueue
Protected methodStartPing
If heartbeat is enabled on this endpoint the method will initiate a ping/pong sequence
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Protected fieldcallbackId
Buffer for callback-id.
Protected fieldcallbackIdPos
Length to read from callbackId
Protected fieldCancellation
CancellationToken used in communication
Protected fieldCloseReason
Reason CloseReason for closing the connection
Protected fieldcontroller
Controller buffer, controller to call is within
Protected fieldcontrollerPos
The length to read from the controller
Protected fieldcontrollerToCall
Cache controller since it will save time when same controller is called for each message
Protected fielddata
Last byte operation read from the IBaseTransport
Protected fielddisposed
Flag for knowing if the object has been disposed
Protected fieldiam
Buffer for the IAM message operation
Protected fieldiampos
Size of the IAM message
Protected fieldInQueue
Queue for incoming data
Protected fieldInteractive
If true the protocol will respond with +OK messages for every valid operation. Only possible for full-duplex connections.
Protected fieldIsAuthenticated
True if the Authenticate(IProtocol) method returned true
Protected fieldlastControllerAsByte
Cache for last controller called
Protected fieldlastControllerKey
Cache for the last controller called as BinaryKey
Protected fieldlastMethodAsByte
Cache for last method called
Protected fieldlastMethodKey
Cache for the last method called as BinaryKey
Protected fieldlen
Length to read from the IBaseTransport
Protected fieldlocker
For blocking simultaneous access to certain areas
Protected fieldmethod
Method buffer, method to call is within
Protected fieldmethodPos
The length to read from the method
Protected fieldmethodToCall
Information about the method to be called ControllerDelegate
Protected fieldOutQueue
Queue for outgoing data
Protected fieldPubQueue
Queue for messages published over a pub/sub pattern
Protected fieldread
Read buffer
Protected fieldReadState
The ReadState for the ReadLoop
Protected fieldrun
The readloop will continue as long as this flag is true. When false the connection will be disposed
Protected fieldsize
Size buffer
Protected fieldsizepos
Size position (for knowing size to read from size buffer)
Protected fieldtopic
Topic parsed from the stream
Protected fieldtopicpos
Length of the topic
Protected fieldunsubcount
Max messages to publish before doing automatic unsubscribe
Protected fieldunsubcountpos
Length of unsub-count
Protected fieldvalidTopic
Flag for knowing if the topic parsed is valid
Protected fieldwrite
Write buffer
Top
See Also