Socket class
Methods
-
clearListeners()
→ void
-
inherited
-
clearTransport()
→ void
-
Clears listeners and timers associated with current transport.
-
close([dynamic discard = false])
→ void
-
Closes the socket and underlying transport.
-
closeTransport(dynamic discard)
→ void
-
Closes the underlying transport.
-
emit(String event, [dynamic data])
→ void
-
inherited
-
flush()
→ void
-
Attempts to flush the packets buffer.
-
getAvailableUpgrades()
→ List
-
Get available upgrades for this socket.
-
hasListeners(String event)
→ bool
-
inherited
-
maybeUpgrade(dynamic transport)
→ void
-
Upgrades socket to the given transport
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
off(String event, [EventHandler? handler])
→ void
-
inherited
-
on(String event, EventHandler handler)
→ void
-
inherited
-
once(String event, EventHandler handler)
→ void
-
inherited
-
onClose(dynamic reason, [dynamic description])
→ void
-
Called upon transport considered closed.
Possible reasons:
ping timeout
, client error
, parse error
,
transport error
, server close
, transport close
-
onError(dynamic err)
→ void
-
Called upon transport error.
-
onOpen()
→ void
-
Called upon transport considered open.
-
onPacket(dynamic packet)
→ void
-
Called upon transport packet.
-
send(dynamic data, dynamic options, [dynamic callback])
→ void
-
Sends a message packet.
-
sendPacket(dynamic type, {dynamic data, dynamic options, dynamic callback})
→ void
-
Sends a packet.
-
setPingTimeout()
→ void
-
Sets and resets ping timeout timer based on client pings.
-
setTransport(Transport transport)
→ void
-
Attaches handlers for the given transport.
-
setupSendCallback()
→ void
-
Setup and manage send callback
-
toString()
→ String
-
A string representation of this object.
inherited
-
write(dynamic data, dynamic options, [dynamic callback])
→ Socket
-