Class RfbConnection
Connection with a remote server using the RFB protocol.
Inheritance
Implements
Namespace: MarcusW.VncClient
Assembly: MarcusW.VncClient.dll
Syntax
public sealed class RfbConnection : INotifyPropertyChanged, IDisposable
Properties
| Improve this Doc View SourceConnectionState
Gets the current connection state. Subscribe to PropertyChanged to receive change notifications.
Declaration
public ConnectionState ConnectionState { get; }
Property Value
Type | Description |
---|---|
ConnectionState |
ContinuousUpdatesEnabled
Gets the current state of the continuous update protocol feature. Subscribe to PropertyChanged to receive change notifications.
Declaration
public bool ContinuousUpdatesEnabled { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
DesktopIsResizable
Gets whether the connection allows client-side desktop size changes. Subscribe to PropertyChanged to receive change notifications.
Declaration
public bool DesktopIsResizable { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
DesktopName
Gets the current name of the remote desktop. Subscribe to PropertyChanged to receive change notifications.
Declaration
public string? DesktopName { get; }
Property Value
Type | Description |
---|---|
System.Nullable<System.String> |
InterruptionCause
Gets the
Declaration
public Exception? InterruptionCause { get; }
Property Value
Type | Description |
---|---|
System.Nullable<Exception> |
LoggerFactory
Gets the logger factory implementation that should be used for creating new loggers.
Declaration
public ILoggerFactory LoggerFactory { get; }
Property Value
Type | Description |
---|---|
ILoggerFactory |
OutputHandler
Gets or sets the handler for output events from the server. Subscribe to PropertyChanged to receive change notifications.
Declaration
public IOutputHandler OutputHandler { get; set; }
Property Value
Type | Description |
---|---|
IOutputHandler |
Parameters
Gets the connect parameters used for establishing this connection.
Declaration
public ConnectParameters Parameters { get; }
Property Value
Type | Description |
---|---|
ConnectParameters |
ProtocolImplementation
Gets the used RFB protocol implementation.
Declaration
public IRfbProtocolImplementation ProtocolImplementation { get; }
Property Value
Type | Description |
---|---|
IRfbProtocolImplementation |
ProtocolVersion
Gets the version of the protocol used for remote communication. Subscribe to PropertyChanged to receive change notifications.
Declaration
public RfbProtocolVersion ProtocolVersion { get; }
Property Value
Type | Description |
---|---|
RfbProtocolVersion |
RemoteFramebufferFormat
Gets the current format of the remote view. Subscribe to PropertyChanged to receive change notifications.
Declaration
public PixelFormat RemoteFramebufferFormat { get; }
Property Value
Type | Description |
---|---|
PixelFormat |
RemoteFramebufferLayout
Gets the current layout of the remote view. Subscribe to PropertyChanged to receive change notifications.
Declaration
public IImmutableSet<Screen> RemoteFramebufferLayout { get; }
Property Value
Type | Description |
---|---|
IImmutableSet<Screen> |
RemoteFramebufferSize
Gets the current size of the remote view. Subscribe to PropertyChanged to receive change notifications.
Declaration
public Size RemoteFramebufferSize { get; }
Property Value
Type | Description |
---|---|
Size |
RenderTarget
Gets or sets the target where received frames should be rendered to. Subscribe to PropertyChanged to receive change notifications.
Declaration
public IRenderTarget RenderTarget { get; set; }
Property Value
Type | Description |
---|---|
IRenderTarget |
UsedEncodingTypes
Gets the encoding types that are currently used by this connection. Subscribe to PropertyChanged to receive change notifications.
Declaration
public IImmutableSet<IEncodingType> UsedEncodingTypes { get; }
Property Value
Type | Description |
---|---|
IImmutableSet<IEncodingType> |
UsedMessageTypes
Gets the message types that are currently used by this connection. Subscribe to PropertyChanged to receive change notifications.
Declaration
public IImmutableSet<IMessageType> UsedMessageTypes { get; }
Property Value
Type | Description |
---|---|
IImmutableSet<IMessageType> |
UsedSecurityType
Gets the security type that was used for authenticating and securing the connection. Subscribe to PropertyChanged to receive change notifications.
Declaration
public ISecurityType UsedSecurityType { get; }
Property Value
Type | Description |
---|---|
ISecurityType |
Methods
| Improve this Doc View SourceCloseAsync()
Closes the running remote connection as well as any running reconnect attempts.
Declaration
public Task CloseAsync()
Returns
Type | Description |
---|---|
Task |
Remarks
To cancel the connection establishment, use the
Dispose()
Declaration
public void Dispose()
EnqueueMessage<TMessageType>(IOutgoingMessage<TMessageType>, CancellationToken)
Adds the message
to the send queue and returns without waiting for it being sent.
Declaration
public bool EnqueueMessage<TMessageType>(IOutgoingMessage<TMessageType> message, CancellationToken cancellationToken = null)
where TMessageType : class, IOutgoingMessageType
Parameters
Type | Name | Description |
---|---|---|
IOutgoingMessage<TMessageType> | message | The message to send. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
System.Boolean | True, if the message was queued, otherwise false. |
Type Parameters
Name | Description |
---|---|
TMessageType | The type of the message. |
Remarks
Please ensure the outgoing message type is marked as being supported by both sides before sending it. See UsedMessageTypes.
SendMessageAsync<TMessageType>(IOutgoingMessage<TMessageType>, CancellationToken)
Adds the message
to the send queue and returns a
Declaration
public Task SendMessageAsync<TMessageType>(IOutgoingMessage<TMessageType> message, CancellationToken cancellationToken = null)
where TMessageType : class, IOutgoingMessageType
Parameters
Type | Name | Description |
---|---|---|
IOutgoingMessage<TMessageType> | message | The message to send. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
Type Parameters
Name | Description |
---|---|
TMessageType | The type of the message. |
Remarks
Please ensure the outgoing message type is marked as being supported by both sides before sending it. See UsedMessageTypes.
Events
| Improve this Doc View SourcePropertyChanged
Declaration
public event PropertyChangedEventHandler? PropertyChanged
Event Type
Type | Description |
---|---|
System.Nullable<PropertyChangedEventHandler> |