C# Класс Simpl.OODSS.Distributed.Server.WebSocketOODSSServer

Наследование: Simpl.OODSS.Distributed.Impl.AbstractServer, ServerProcessor
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
ClientSessionManagerMap WebSocketClientSessionManager>.DictionaryList
CloseEvent System.Threading.AutoResetEvent
DataReceiveEvent System.Threading.AutoResetEvent
MaxMessageSize int
MessageReceiveEvent System.Threading.AutoResetEvent
OpenedEvent System.Threading.AutoResetEvent
ServerThread Thread

Открытые методы

Метод Описание
ProcessRead ( WebSocketSession session, long uid, string message ) : void

process the recieved message and uid. if sessionManager does not exist, create add it to the client session manager map process the message and send the response message back to the client

RestoreContextManagerFromSessionId ( string incomingSessionId, string newSessionId, BaseSessionManager newSessionManager ) : bool

restore old sessionManager for recovered session. returns true if the session is restored, false if the old session doesn't exist thus cannot be restored.

Start ( ) : bool

start server

Stop ( ) : void

stop server

WebSocketOODSSServer ( SimplTypesScope serverTranslationScope, Scope applicationObjectScope, int idleConnectionTimeout = -1, int maxMessageSize = -1, int port ) : System

Initialize a websocket oodss server object

processSessionClosed ( string sessionid ) : void

Защищенные методы

Метод Описание
GenerateContextManager ( string sessionId, SimplTypesScope translationScope, Scope applicationObjectScope ) : BaseSessionManager

Generate WebSocketClientSessionManager

SendUpdateMessage ( string sessionId, UpdateMessage updateMessage ) : void

called by the session manager to send out update message.

WebSocketServer_SessionClosed ( WebSocketSession session, CloseReason reason ) : void

Приватные методы

Метод Описание
CreatePacketFromMessageAndSend ( long uid, ServiceMessage message, WebSocketSession session ) : void

helper function to generate and send byte array message to client session.

SetUpWebSocketServer ( int port ) : void
WebSocketServer_NewDataReceived ( WebSocketSession session, byte e ) : void
WebSocketServer_NewMessageReceived ( WebSocketSession session, string e ) : void
WebSocketServer_NewSessionConnected ( WebSocketSession session ) : void

Описание методов

GenerateContextManager() защищенный Метод

Generate WebSocketClientSessionManager
protected GenerateContextManager ( string sessionId, SimplTypesScope translationScope, Scope applicationObjectScope ) : BaseSessionManager
sessionId string client's session id
translationScope Simpl.Serialization.SimplTypesScope translation scope for the server
applicationObjectScope Scope server's application scope
Результат Simpl.OODSS.Distributed.Server.ClientSessionManager.BaseSessionManager

ProcessRead() публичный Метод

process the recieved message and uid. if sessionManager does not exist, create add it to the client session manager map process the message and send the response message back to the client
public ProcessRead ( WebSocketSession session, long uid, string message ) : void
session WebSocketSession the client's websocket session
uid long uid of the message
message string message in serialized form
Результат void

RestoreContextManagerFromSessionId() публичный Метод

restore old sessionManager for recovered session. returns true if the session is restored, false if the old session doesn't exist thus cannot be restored.
public RestoreContextManagerFromSessionId ( string incomingSessionId, string newSessionId, BaseSessionManager newSessionManager ) : bool
incomingSessionId string received sesion id information
newSessionId string
newSessionManager Simpl.OODSS.Distributed.Server.ClientSessionManager.BaseSessionManager a new session manager
Результат bool

SendUpdateMessage() защищенный Метод

called by the session manager to send out update message.
protected SendUpdateMessage ( string sessionId, UpdateMessage updateMessage ) : void
sessionId string client's session id
updateMessage Simpl.OODSS.Messages.UpdateMessage update message
Результат void

Start() публичный Метод

start server
public Start ( ) : bool
Результат bool

Stop() публичный Метод

stop server
public Stop ( ) : void
Результат void

WebSocketOODSSServer() публичный Метод

Initialize a websocket oodss server object
public WebSocketOODSSServer ( SimplTypesScope serverTranslationScope, Scope applicationObjectScope, int idleConnectionTimeout = -1, int maxMessageSize = -1, int port ) : System
serverTranslationScope Simpl.Serialization.SimplTypesScope translationscope for the oodss messages
applicationObjectScope Scope server object scope
idleConnectionTimeout int
maxMessageSize int
port int
Результат System

WebSocketServer_SessionClosed() защищенный Метод

protected WebSocketServer_SessionClosed ( WebSocketSession session, CloseReason reason ) : void
session WebSocketSession
reason CloseReason
Результат void

processSessionClosed() публичный Метод

public processSessionClosed ( string sessionid ) : void
sessionid string
Результат void

Описание свойств

ClientSessionManagerMap защищенное свойство

protected DictionaryList ClientSessionManagerMap
Результат WebSocketClientSessionManager>.DictionaryList

CloseEvent защищенное свойство

protected AutoResetEvent,System.Threading CloseEvent
Результат System.Threading.AutoResetEvent

DataReceiveEvent защищенное свойство

protected AutoResetEvent,System.Threading DataReceiveEvent
Результат System.Threading.AutoResetEvent

MaxMessageSize защищенное свойство

protected int MaxMessageSize
Результат int

MessageReceiveEvent защищенное свойство

protected AutoResetEvent,System.Threading MessageReceiveEvent
Результат System.Threading.AutoResetEvent

OpenedEvent защищенное свойство

protected AutoResetEvent,System.Threading OpenedEvent
Результат System.Threading.AutoResetEvent

ServerThread защищенное свойство

protected Thread ServerThread
Результат Thread