Show / Hide Table of Contents

Class RfbConnection

Connection with a remote server using the RFB protocol.

Inheritance
System.Object
RfbConnection
Implements
IDisposable
Namespace: MarcusW.VncClient
Assembly: MarcusW.VncClient.dll
Syntax
public sealed class RfbConnection : INotifyPropertyChanged, IDisposable

Properties

| Improve this Doc View Source

ConnectionState

Gets the current connection state. Subscribe to PropertyChanged to receive change notifications.

Declaration
public ConnectionState ConnectionState { get; }
Property Value
Type Description
ConnectionState
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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>
| Improve this Doc View Source

InterruptionCause

Gets the that caused the last connection interruption. Subscribe to PropertyChanged to receive change notifications.

Declaration
public Exception? InterruptionCause { get; }
Property Value
Type Description
System.Nullable<Exception>
| Improve this Doc View Source

LoggerFactory

Gets the logger factory implementation that should be used for creating new loggers.

Declaration
public ILoggerFactory LoggerFactory { get; }
Property Value
Type Description
ILoggerFactory
| Improve this Doc View Source

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
| Improve this Doc View Source

Parameters

Gets the connect parameters used for establishing this connection.

Declaration
public ConnectParameters Parameters { get; }
Property Value
Type Description
ConnectParameters
| Improve this Doc View Source

ProtocolImplementation

Gets the used RFB protocol implementation.

Declaration
public IRfbProtocolImplementation ProtocolImplementation { get; }
Property Value
Type Description
IRfbProtocolImplementation
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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>
| Improve this Doc View Source

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
| Improve this Doc View Source

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
| Improve this Doc View Source

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>
| Improve this Doc View Source

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>
| Improve this Doc View Source

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 Source

CloseAsync()

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 passed to MarcusW.VncClient.RfbConnection.StartAsync(CancellationToken) instead.

| Improve this Doc View Source

Dispose()

Declaration
public void Dispose()
| Improve this Doc View Source

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.

| Improve this Doc View Source

SendMessageAsync<TMessageType>(IOutgoingMessage<TMessageType>, CancellationToken)

Adds the message to the send queue and returns a that completes when the message was sent.

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 Source

PropertyChanged

Declaration
public event PropertyChangedEventHandler? PropertyChanged
Event Type
Type Description
System.Nullable<PropertyChangedEventHandler>

Implements

IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX