BaseSocketWrapper class abstract
This class is the base for a socket that XmppConnection can use.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → void - This must close the socket but not the streams so that the same class can be reused by calling this.connect again.
-
connect(
String domain, {String? host, int? port}) → Future< bool> -
This must connect to
host
:port
and initialize the streams accordingly.domain
is the domain that TLS should be validated against, in case the Socket provides TLS encryption. Returns true if the connection has been successfully established. Returns false if the connection has failed. -
getDataStream(
) → Stream< String> - This must return the unbuffered string stream that the socket receives.
-
getEventStream(
) → Stream< XmppSocketEvent> -
This must return events generated by the socket.
See sub-classes of
XmppSocketEvent
for possible events. -
isSecure(
) → bool - Returns true if the socket is secured, e.g. using TLS.
-
managesKeepalives(
) → bool - Returns true if it manages its own keepalive pings, like websockets. False if not.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
prepareDisconnect(
) → void - Brings the socket into a state that allows it to close without triggering any errors to the XmppConnection.
-
secure(
String domain) → Future< bool> - Upgrades the connection into a secure version, e.g. by performing a TLS upgrade. May do nothing if the connection is always secure. Returns true if the socket has been successfully upgraded. False otherwise.
-
toString(
) → String -
A string representation of this object.
inherited
-
whitespacePingAllowed(
) → bool - Returns true if whitespace pings are allowed. False if not.
-
write(
String data) → void -
Write
data
into the socket.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited