# SocketTask.onOpen(function callback)
with Promise style call: Not supported
Mini Program plugin: Support
to monitor WebSocket Connection Open Event
# parameter
# function callback
WebSocket Connect callback functions for open events
# parameter
# Object res
attribute | type | Introductions | Minimum version |
---|---|---|---|
header | object | Successfully connected HTTP response Header | 2.0.0 |
profile | Object | Some debugging information during the network request process | 2.10.4 |
profile Structure
attribute | type | Introductions |
---|---|---|
fetchStart | number | Components ready to use SOCKET Time to set up the request, which occurs before checking the local cache |
domainLookupStart | number | DNS When the domain name query started, if local caching was used DNS Query) or persistent connection, with the fetchStart Value equality |
domainLookupEnd | number | DNS When the domain name query was completed, if local caching was used DNS Query) or persistent connection, with the fetchStart Value equality |
connectStart | number | When a connection is established, and if the connection is persistent, the fetchStart Values are equal. Note that if an error occurs at the transport layer and a connection is reestablished, this shows the time when the newly established connection started |
connectEnd | number | Time to complete the connection establishment (complete handshake), or if the connection is persistent, with the fetchStart Values are equal. Note that if an error occurs at the transport layer and the connection is reestablished, the time when the newly established connection was completed is shown here. Note the end of the handshake, including the establishment of the security connection, SOCKS Authorized by |
rtt | number | Time consuming for a single connection, including connect ,tls |
handshakeCost | number | Handshake time |
cost | number | Upper request to return time |