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