Socket class

Socket constructor.

@api public

Inheritance
Available extensions

Constructors

Socket(Manager io, String nsp, Map? opts)

Properties

acks Map
getter/setter pair
active bool
Whether the Socket will try to reconnect when its Manager connects or reconnects
no setter
connected bool
getter/setter pair
disconnected bool
getter/setter pair
flags Map?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id String?
getter/setter pair
ids num
getter/setter pair
io Manager
getter/setter pair
json Socket
getter/setter pair
nsp String
getter/setter pair
opts Map?
getter/setter pair
query String?
getter/setter pair
receiveBuffer List
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendBuffer List
getter/setter pair
subs List?
getter/setter pair

Methods

ack(dynamic id) Function
Produces an ack callback to emit with an event.
clearListeners() → void
This function unbinds all the handlers for all the events.
inherited
close() Socket
Disconnects the socket manually.
compress(dynamic compress) Socket
Sets the compress flag.
connect() Socket
destroy() → void
Called upon forced client/server side disconnections, this method ensures the manager stops tracking us and that reconnections don't get triggered for this.
disconnect() Socket
dispose() → void
Disposes the socket manually which will destroy, close, disconnect the socket connection and clear all the event listeners. Unlike close or disconnect which won't clear all the event listeners
emit(String event, [dynamic data]) → void
Override emit. If the event is in events, it's emitted normally.
override
emitBuffered() → void
Emit buffered events (received and emitted).
emitWithAck(String event, dynamic data, {Function? ack, bool binary = false}) → void
Emits to this client.
emitWithBinary(String event, [dynamic data]) → void
hasListeners(String event) bool
Returns whether the event has registered.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
off(String event, [EventHandler? handler]) → void
This function attempts to unbind the handler from the event
inherited
on(String event, EventHandler handler) → void
This function binds the handler as a listener to the event
inherited
onack(Map packet) → void
Called upon a server acknowlegement.
once(String event, EventHandler handler) → void
This function binds the handler as a listener to the first occurrence of the event. When handler is called once, it is removed.
inherited
onclose(dynamic reason) → void
Called upon engine close.
onconnect() → void
Called upon server connect.
ondisconnect() → void
Called upon server disconnect.
onevent(Map packet) → void
Called upon a server event.
onopen([dynamic _]) → void
Called upon engine open.
onpacket(dynamic packet) → void
Called with socket packet.
open() Socket
"Opens" the socket.
packet(Map packet) → void
Sends a packet.
send(List args) Socket
Sends a message event.
subEvents() → void
Subscribe to open, close and packet events
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited