Show / Hide Table of Contents

Class RfbMessageSender

A background thread that sends queued messages and provides methods to add messages to the send queue.

Inheritance
System.Object
BackgroundThread
RfbMessageSender
Implements
IRfbMessageSender
IBackgroundThread
IDisposable
Inherited Members
BackgroundThread.Failed
BackgroundThread.Start()
BackgroundThread.StopAndWaitAsync()
BackgroundThread.Dispose()
Namespace: MarcusW.VncClient.Protocol.Implementation.Services.Communication
Assembly: MarcusW.VncClient.dll
Syntax
public class RfbMessageSender : BackgroundThread, IRfbMessageSender, IBackgroundThread, IDisposable

Constructors

| Improve this Doc View Source

RfbMessageSender(RfbConnectionContext)

Initializes a new instance of the RfbMessageSender.

Declaration
public RfbMessageSender(RfbConnectionContext context)
Parameters
Type Name Description
RfbConnectionContext context

The connection context.

Methods

| Improve this Doc View Source

Dispose(Boolean)

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing
Overrides
BackgroundThread.Dispose(Boolean)
| Improve this Doc View Source

EnqueueInitialMessages(CancellationToken)

Enqueues some initial messages to get things rolling.

Declaration
public void EnqueueInitialMessages(CancellationToken cancellationToken = null)
Parameters
Type Name Description
CancellationToken cancellationToken

The cancellation token.

| 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 void 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.

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

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

Adds the message to the send queue and waits synchronously for the message being sent.

Declaration
public void SendMessageAndWait<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.

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

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

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

Declaration
public Task SendMessageAndWaitAsync<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.

| Improve this Doc View Source

StartSendLoop()

Starts the send loop.

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

StopSendLoopAsync()

Stops the send loop and waits for completion.

Declaration
public Task StopSendLoopAsync()
Returns
Type Description
Task
| Improve this Doc View Source

ThreadWorker(CancellationToken)

Declaration
protected override void ThreadWorker(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken
Overrides
BackgroundThread.ThreadWorker(CancellationToken)

Implements

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