C# 클래스 Zazzles.Bus

An event driven IPC interface. Can also be used to send event only within the running process.
파일 보기 프로젝트 열기: FOGProject/zazzles 1 사용 예제들

공개 메소드들

메소드 설명
Dispose ( ) : void
Emit ( Channel channel, Newtonsoft.Json.Linq.JObject data, bool global = false ) : void

Emit a message to all listeners

GetCurrentMode ( ) : Mode
SetMode ( Mode mode ) : void

Set the mode of the bus instance. Upon calling this method, the IPC interface will initialize.

Subscribe ( Channel channel, Action action ) : void

Register an action with a channel. When a message is recieved on this channel, the method will be called.

Unsubscribe ( Channel channel, Action action ) : void

Unregister an action from a channel

비공개 메소드들

메소드 설명
Emit ( Channel channel, string data, bool global = false ) : void

Emit a message to all listeners

EmitMessageFromSocket ( string message ) : void

Parse a message recieved in the socket and emit it to channels confined in its instance

Initializesocket ( ) : void

Initiate the socket that connects to all other FOG bus instances It MUST be assumed that this socket is compromised Do NOT send security relevant data across it

SendMessage ( string msg ) : void

Send a message to other bus instances

client_connect ( WebSocketSession clientSession ) : void
socket_RecieveMessage ( WebSocketSession session, string value ) : void

Called when the socket client recieves a message

socket_RecieveMessage ( object sender, WebSocket4Net.MessageReceivedEventArgs messageReceivedEventArgs ) : void

Called when the server socket recieves a message It will replay the message to all other instances, including the original sender unless told otherwise

메소드 상세

Dispose() 공개 정적인 메소드

public static Dispose ( ) : void
리턴 void

Emit() 공개 정적인 메소드

Emit a message to all listeners
public static Emit ( Channel channel, Newtonsoft.Json.Linq.JObject data, bool global = false ) : void
channel Channel The channel to emit on
data Newtonsoft.Json.Linq.JObject The data to send
global bool Should the data be sent to other processes
리턴 void

GetCurrentMode() 공개 정적인 메소드

public static GetCurrentMode ( ) : Mode
리턴 Mode

SetMode() 공개 정적인 메소드

Set the mode of the bus instance. Upon calling this method, the IPC interface will initialize.
public static SetMode ( Mode mode ) : void
mode Mode
리턴 void

Subscribe() 공개 정적인 메소드

Register an action with a channel. When a message is recieved on this channel, the method will be called.
public static Subscribe ( Channel channel, Action action ) : void
channel Channel The channel to register within
action Action The action (method) to register
리턴 void

Unsubscribe() 공개 정적인 메소드

Unregister an action from a channel
public static Unsubscribe ( Channel channel, Action action ) : void
channel Channel
action Action
리턴 void