ServerWebsocket class

Constructors

ServerWebsocket({required PteroClient client, required String serverId, FutureOr<void> onConnectionError(Object error, StackTrace stacktrace)?, bool autoConnect = true})
Start a connection to the server's websocket.

Properties

backupStatus → ValueStream<BackupStatus>
no setter
client → PteroClient
final
connectionState → ValueStream<ConnectionState>
no setter
errors → ValueStream<ServerWebsocketException>
no setter
hashCode → int
The hash code for this object.
no setterinherited
installStatus → ValueStream<InstallStatus>
no setter
isClosed → bool
no setter
isDisconnected → bool
no setter
logs → ValueStream<WebsocketLog>
no setter
powerState → ValueStream<ServerPowerState>
no setter
ready → Future<void>
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
serverId → String
final
stats → ValueStream<WebsocketStats>
no setter
transferStatus → ValueStream<TransferStatus>
no setter

Methods

close() → Future<void>
Fully close the websocket and all streams
disconnect() → Future<void>
Disconnect but don't close user-facing streams
killServer() → Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestLogs() → Future<void>
requestStats() → Future<void>
restartServer() → Future<void>
sendCommand(String command) → Future<void>
setPowerState(ServerPowerAction powerAction) → Future<void>
startServer() → Future<void>
stopServer() → Future<void>
toString() → String
A string representation of this object.
inherited

Operators

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

Static Properties

log ↔ void Function(String message, {Object? error, String name, StackTrace? stackTrace})
getter/setter pair

Static Methods

connect({required PteroClient client, required String serverId}) → Future<ServerWebsocket>
Connect to the websocket for a server and return the ServerWebsocket once it's authenticated.