Socket class

Socket constructor.

@api public

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
auth ↔ dynamic
getter/setter pair
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
lastOffset String?
getter/setter pair
nsp String
getter/setter pair
opts Map?
getter/setter pair
pid String?
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.
emitBuffered() → void
Emit buffered events (received and emitted).
emitWithAck(String event, dynamic data, {Function? ack, bool binary = false}) → void
Emits to this client.
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
offAny([AnyEventHandler? handler]) → void
This function attempts to unbind the handler. If the given handler is null, this function unbinds all any event handlers.
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.
onAny(AnyEventHandler handler) → void
This function binds the handler as a listener to any event
inherited
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(dynamic id, dynamic pid) → void
Called upon server connect.
ondisconnect() → void
Called upon server disconnect.
onerror(dynamic err) → void
Called upon engine or manager error
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.
sendConnectPacket(Map? data) → void
Sends a CONNECT packet to initiate the Socket.IO session.
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