SocketConnector class
A class for managing socket connections with address caching.
Supports secure and non-secure socket connections.
- Inheritance
-
- Object
- HostResolver
- SocketConnector
Constructors
- SocketConnector({bool onBadCertificate(X509Certificate certificate)?})
- Creates an instance of SocketConnector.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- onBadCertificate → bool Function(X509Certificate certificate)?
-
A callback for handling invalid certificates in secure connections.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
checkAddressesCacheTimeout(
Duration cacheTimeout) → bool -
Checks if the address cache has exceeded the specified timeout.
inherited
-
clearAddressesCache(
) → void -
Clears the cached addresses and updates the cache timestamp.
inherited
-
connectSecureSocket(
InternetAddress address, int port, SecurityContext? context) → Future< SecureSocket> -
Connects to a secure socket at the specified
address
andport
. -
connectSocket(
InternetAddress address, int port) → Future< Socket> -
Connects to a non-secure socket at the specified
address
andport
. -
lookupAddress(
String hostname) → FutureOr< List< InternetAddress> > -
Resolves the IP addresses for the given
hostname
, using cache if available.inherited -
lookupAddressImpl(
String hostname) → Future< List< InternetAddress> > -
Performs the actual DNS lookup for the given
hostname
.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openSocket(
String host, int port, {bool secure = false, SecurityContext? context}) → Future< Socket> -
Opens a socket connection to the specified
host
andport
. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited