Socket class

Constructors

Socket(Namespace nsp, Client client, dynamic query)

Properties

acks Map
getter/setter pair
adapter ↔ Adapter
getter/setter pair
broadcast Socket
no setter
client ↔ Client
getter/setter pair
conn ↔ dynamic
getter/setter pair
connected bool
getter/setter pair
data Map
getter/setter pair
disconnected bool
getter/setter pair
flags Map<String, bool>?
getter/setter pair
handshake Map?
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id String
getter/setter pair
json Socket
no setter
nsp ↔ Namespace
getter/setter pair
request HttpRequest
getter/setter pair
roomList List
getter/setter pair
roomMap Map
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
server Server
getter/setter pair
volatile Socket
no setter

Methods

ack(dynamic id) Function
Produces an ack callback to emit with an event.
buildHandshake(dynamic query) Map
Builds the handshake BC object
clearListeners() → void
This function unbinds all the handlers for all the events.
inherited
compress(dynamic compress) Socket
Sets the compress flag.
disconnect([dynamic close]) Socket
Disconnects this client.
emit(String event, [dynamic data]) → void
This function triggers all the handlers currently listening to event and passes them data.
emitWithAck(String event, dynamic data, {Function? ack, bool binary = false}) → void
Emits to this client.
emitWithBinary(String event, [dynamic data]) → void
error(dynamic err) → void
Produces an error packet.
hasListeners(String event) bool
Returns whether the event has registered.
inherited
join(dynamic room, [dynamic fn]) Socket
Joins a room.
leave(dynamic room, dynamic fn) Socket
Leaves a room.
leaveAll() → void
Leave all rooms.
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(dynamic packet) → void
Called upon ack packet.
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]) → dynamic
Called upon closing. Called by Client.
onconnect() → void
Called by Namespace upon succesful middleware execution (ie: authorization).
ondisconnect() → void
Called upon client disconnect packet.
onerror(dynamic err) → void
Handles a client error.
onevent(dynamic packet) → void
Called upon event packet.
onpacket(dynamic packet) → void
Called with each packet. Called by Client.
packet(dynamic packet, [dynamic opts]) → void
Writes a packet.
send(dynamic _) → void
Sends a message event.
to(String name) Socket
Targets a room when broadcasting.
toString() String
A string representation of this object.
inherited
write(List data) Socket

Operators

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