Quark
#
Modules #
quark/action
quark/app
quark/bubbles
quark/buffer
quark/checkbox
quark/css
quark/ctr
quark/dialog
quark/event
quark/font
quark/fs
quark/hash
quark/http
quark/index
quark/jsonb
quark/keyboard
quark/media
quark/nav
quark/net
quark/os
quark/path
quark/pkg
quark/screen
quark/stepper
quark/storage
quark/test
quark/types
quark/util
quark/view
quark/window
quark/ws
quark/_buffer
quark/_common
quark/_event
quark/_ext
quark/_md5
quark/_sha1
quark/_sha256
quark/_util
quark/_watching
Quark v1.3.0 Documentation
Table of Contents
quark/ws #
Enum: PacketType #
PacketType #
Defines the types of packets used in WSClient communication.
Interface: Packet #
Packet #
Represents a packet structure used in WSClient communication.
Class: WSConversation #
WSConversation #
WSConversation is extended from WebSocket to provide a WSClient connection.
@extends
WebSocket
wsconversation.token #
Session token
@get
token
:
wsconversation.autoReconnect #
autoReconnect
:
wsconversation.connect() #
@override
Connect to the WebSocket server.@return
void
wsconversation.close() #
@override
Close the conversation connection.
wsconversation.sendPacket(p) #
Send a packet to the server.
METHOD_CALL_TIMEOUT #
120s
@const
METHOD_CALL_TIMEOUT
:
Class: WSCEvent #
WSCEvent #
wscevent.remoteSender #
@get
remoteSender
:string
wscevent.constructor(data?,sender?) #
@param
data?
:any
Event data@param
sender?
:string
Remote sender id
Class: WSClient #
WSClient #
WSClient is Qktool's WebSocket service client.
Through it, you can call the service methods of server provided or listen to the service events.
@extends
Notification
<WSCEvent
>
wsclient.name #
Service name on the server
@get
name
:string
wsclient.conv #
Conversation instance
@get
conv
:WSConversation
wsclient.onLoad #
Triggered when the client is loaded and ready to use.
@event
onLoad
:EventNoticer
<WSCEvent
>
wsclient.constructor(serviceName,conv) #
@param
serviceName
:string
Service name on the server@param
conv
:WSConversation
Conversation instance
wsclient.receiveMessage(packet) #
To handle received messages from the server.
wsclient.callMethod(method,data,sender) #
The remote service calls a method on the client by the method name.
@param
method
:string
@param
data
:any
@param
sender
:string
@param
method
: Method name to call@param
data?
: Data to send@param
timeout?
: Timeout in milliseconds, default 120s@param
sender?
: Sender name, default this service name
wsclient.send(method,data?,sender?) #
To call a method on the server but there will be no callback.