Interface IRustPlusFcmSocket
- Namespace
- RustPlusApi.Fcm.Interfaces
- Assembly
- RustPlusApi.Fcm.dll
Defines the connection lifecycle and notification events for a low-level FCM MCS socket. Clients are disposable; prefer DisposeAsync() so teardown drains background work.
public interface IRustPlusFcmSocket : IDisposable, IAsyncDisposable
- Inherited Members
Methods
ConnectAsync(CancellationToken)
Connects to the FCM MCS endpoint and begins receiving notifications. On failure,
ErrorOccurred is raised and the exception is rethrown. Instances are single-connection:
after Disconnect() or disposal, create a new instance to reconnect.
Task ConnectAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenA token to cancel the connection attempt.
Returns
Exceptions
- InvalidOperationException
Thrown when the socket is already connected or was closed.
Disconnect()
Cancels the receive loop and releases socket resources.
void Disconnect()
Events
Connected
Raised when the client has successfully connected and logged in.
event EventHandler? Connected
Event Type
Connecting
Raised when the client begins connecting to the FCM server.
event EventHandler? Connecting
Event Type
Disconnected
Raised when the client has fully disconnected.
event EventHandler? Disconnected
Event Type
Disconnecting
Raised when the client begins disconnecting.
event EventHandler? Disconnecting
Event Type
ErrorOccurred
Raised when an unhandled exception occurs on the receive loop.
event EventHandler<Exception>? ErrorOccurred
Event Type
NotificationReceived
Raised when a raw FCM notification JSON string is received.
event EventHandler<string>? NotificationReceived
Event Type
SocketClosed
Raised when the server sends a close tag.
event EventHandler? SocketClosed