Socket class

Socket constructor.

@param {String|Object} uri or options @param {Object} options @api public

Inheritance

Constructors

Socket(String uri, Map? initialOpts)

Properties

agent bool
getter/setter pair
binaryType ↔ dynamic
getter/setter pair
enablesXDR bool
getter/setter pair
extraHeaders Map
getter/setter pair
forceBase64 bool
getter/setter pair
forceJSONP bool
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hostname String
getter/setter pair
id String?
getter/setter pair
jsonp bool
getter/setter pair
onlyBinaryUpgrades bool
getter/setter pair
opts Map
getter/setter pair
path ↔ dynamic
getter/setter pair
perMessageDeflate Map
getter/setter pair
pingInterval int?
getter/setter pair
pingIntervalTimer Timer?
getter/setter pair
pingTimeout int?
getter/setter pair
pingTimeoutTimer Timer?
getter/setter pair
policyPort int
getter/setter pair
port int
getter/setter pair
prevBufferLen int
getter/setter pair
query Map
getter/setter pair
readyState String
getter/setter pair
rememberUpgrade bool?
getter/setter pair
requestTimeout int
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secure bool
getter/setter pair
supportsBinary bool
getter/setter pair
timestampParam String
getter/setter pair
timestampRequests ↔ dynamic
getter/setter pair
transport Transport?
getter/setter pair
transportOptions Map
getter/setter pair
transports List<String>
getter/setter pair
upgrade bool
getter/setter pair
upgrades List
getter/setter pair
upgrading bool
getter/setter pair
uri Uri
getter/setter pair
writeBuffer List
getter/setter pair

Methods

clearListeners() → void
This function unbinds all the handlers for all the events.
inherited
close() Socket
Closes the connection.
createTransport(dynamic name, [dynamic options]) Transport
Creates transport of the given type.
emit(String event, [dynamic data]) → void
This function triggers all the handlers currently listening to event and passes them data.
inherited
filterUpgrades(List upgrades) List
Filters upgrades, returning only those matching client transports.
flush() → void
Flush write buffers.
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
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 desc]) → void
Called upon transport close.
onDrain() → void
Called on drain event
onError(dynamic err) → void
Called upon transport error
onHandshake(Map data) → void
Called upon handshake completion.
onHeartbeat(dynamic timeout) → void
Resets ping timeout.
onOpen() → void
Called when connection is deemed open.
onOutOfBand(dynamic data) → void
Called on outOfBand event
onPacket(Map packet) → void
Handles a packet.
open() → void
Initializes transport to use and starts probe.
ping() → void
Sends a ping packet.
probe(dynamic name) → void
Probes a transport.
send(dynamic msg, dynamic options, [EventHandler? fn]) Socket
sendPacket({dynamic type, dynamic data, dynamic options, EventHandler? callback}) → void
Sends a packet.
setPing() → void
Pings server every this.pingInterval and expects response within this.pingTimeout or closes connection.
setTransport(dynamic transport) → void
Sets the current transport. Disables the existing one (if any).
toString() String
A string representation of this object.
inherited
write(dynamic msg, dynamic options, [EventHandler? fn]) Socket
Sends a message.

Operators

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

Static Properties

priorWebsocketSuccess bool
getter/setter pair
protocol int
Protocol version.
getter/setter pair