예제 #1
0
 public void Ping()
 {
     if (this.objectId.HasValue)
     {
         JslibInterop.WsSend(this.objectId.Value, "");
     }
 }
예제 #2
0
 public void Close(WsCloseCode code = WsCloseCode.Normal, string reason = null)
 {
     if (this.objectId.HasValue)
     {
         JslibInterop.WsClose(this.objectId.Value, (int)code, reason);
     }
 }
예제 #3
0
 public void Send(string message)
 {
     if (this.objectId.HasValue)
     {
         JslibInterop.WsSend(this.objectId.Value, message);
     }
 }
예제 #4
0
 static JslibInterop()
 {
     JslibInterop.WsSetEventHandlers(
         JslibInterop.WsHandleOnOpen,
         JslibInterop.WsHandleOnMessage,
         JslibInterop.WsHandleOnError,
         JslibInterop.WsHandleOnClose);
 }
예제 #5
0
 public void Connect(string url, string protocols)
 {
     this.objectId = JslibInterop.WsCreate(url, protocols);
     JslibInterop.WsOpen(this.objectId.Value);
 }