C# Class ServerSentEvent4Net.ServerSentEvent

Inheritance: IServerSentEvent
Show file Open project: erizet/ServerSentEvent4Net

Protected Properties

Property Type Description
_logger slf4net.ILogger
mClients List
mHeartbeatInterval int
mHeartbeatTimer System.Threading.Timer
mIdGenerator IMessageIdGenerator
mLock object
mMessageHistory IMessageHistory

Public Methods

Method Description
AddSubscriber ( HttpRequestMessage request ) : HttpResponseMessage
Send ( string data ) : void
Send ( string data, string eventType ) : void
Send ( string data, string eventType, string messageId ) : void
ServerSentEvent ( IMessageHistory messageHistory, IMessageIdGenerator idGenerator, int heartbeatInterval ) : System
ServerSentEvent ( int noOfMessagesToRemember, bool generateMessageIds = false, int heartbeatInterval ) : System

Protected Methods

Method Description
AddClient ( Client client ) : void
CheckMessage ( Message msg ) : void
GetLastMessageId ( HttpContent content ) : string
OnStreamAvailable ( Stream stream, System content, System context ) : void
OnSubscriberAdded ( int subscriberCount ) : void
OnSubscriberRemoved ( int subscriberCount ) : void
SendAndRemoveDisconneced ( List clientsToSendTo, Message msg ) : void
SetupHeartbeat ( int heartbeatInterval ) : void

Private Methods

Method Description
Send ( Message msg ) : void
TimerCallback ( object state ) : void

Method Details

AddClient() protected method

protected AddClient ( Client client ) : void
client Client
return void

AddSubscriber() public method

public AddSubscriber ( HttpRequestMessage request ) : HttpResponseMessage
request System.Net.Http.HttpRequestMessage
return System.Net.Http.HttpResponseMessage

CheckMessage() protected method

protected CheckMessage ( Message msg ) : void
msg Message
return void

GetLastMessageId() protected method

protected GetLastMessageId ( HttpContent content ) : string
content System.Net.Http.HttpContent
return string

OnStreamAvailable() protected method

protected OnStreamAvailable ( Stream stream, System content, System context ) : void
stream Stream
content System
context System
return void

OnSubscriberAdded() protected method

protected OnSubscriberAdded ( int subscriberCount ) : void
subscriberCount int
return void

OnSubscriberRemoved() protected method

protected OnSubscriberRemoved ( int subscriberCount ) : void
subscriberCount int
return void

Send() public method

public Send ( string data ) : void
data string
return void

Send() public method

public Send ( string data, string eventType ) : void
data string
eventType string
return void

Send() public method

public Send ( string data, string eventType, string messageId ) : void
data string
eventType string
messageId string
return void

SendAndRemoveDisconneced() protected method

protected SendAndRemoveDisconneced ( List clientsToSendTo, Message msg ) : void
clientsToSendTo List
msg Message
return void

ServerSentEvent() public method

public ServerSentEvent ( IMessageHistory messageHistory, IMessageIdGenerator idGenerator, int heartbeatInterval ) : System
messageHistory IMessageHistory
idGenerator IMessageIdGenerator
heartbeatInterval int
return System

ServerSentEvent() public method

public ServerSentEvent ( int noOfMessagesToRemember, bool generateMessageIds = false, int heartbeatInterval ) : System
noOfMessagesToRemember int
generateMessageIds bool
heartbeatInterval int
return System

SetupHeartbeat() protected method

protected SetupHeartbeat ( int heartbeatInterval ) : void
heartbeatInterval int
return void

Property Details

_logger protected static property

protected static slf4net.ILogger _logger
return slf4net.ILogger

mClients protected property

protected List mClients
return List

mHeartbeatInterval protected property

protected int mHeartbeatInterval
return int

mHeartbeatTimer protected property

protected Timer,System.Threading mHeartbeatTimer
return System.Threading.Timer

mIdGenerator protected property

protected IMessageIdGenerator mIdGenerator
return IMessageIdGenerator

mLock protected property

protected object mLock
return object

mMessageHistory protected property

protected IMessageHistory mMessageHistory
return IMessageHistory