C# 클래스 Simpl.OODSS.Distributed.Server.WebSocketOODSSServer

상속: Simpl.OODSS.Distributed.Impl.AbstractServer, ServerProcessor
파일 보기 프로젝트 열기: ecologylab/simplCSharp 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
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