TCnClientWebSocket Class

Provides a client for connecting to WebSocket services.

Namespace: CNClrLib.Component.ClientWebSocket
TComponent
  CNClrLib.Control.Base.TClrBaseComponent
    CNClrLib.Component.ClientWebSocket.TCnClientWebSocket
type
 TCnClientWebSocket = class(TClrBaseComponent)
 end;

The TCnClientWebSocket type exposes the following members.

Show:
 NameDescription
Create(TComponent)

Creates and initializes a TCnClientWebSocket instance. (Overrides TClrBaseComponent.Create(TComponent).)

Destroy

Frees the resources allocated with a TCnClientWebSocket instance. (Overrides TClrBaseComponent.Destroy.)

Top
Show:
 NameDescription
ByteLength

The length of the buffer to receive the response.

CloseStatus

Gets the reason why the close handshake was initiated on TCnClientWebSocket instance.

CloseStatusDescription

Gets a description of the reason why the TCnClientWebSocket instance was closed.

DefaultClrObject

Get the common language runtime object interface for this component. (Inherited from TClrBaseComponent.)

MessageType

Specifies whether the buffer is clear text or in a binary format.

Options

Gets the WebSocket options for the TCnClientWebSocket instance.

State

Get the WebSocket state of the TCnClientWebSocket instance.

SubProtocol

Gets the supported WebSocket sub-protocol for the TCnClientWebSocket instance.

UriString

The URI of the WebSocket server to connect to.

Top
Show:
 NameDescription
Abort

Aborts the connection and cancels any pending IO operations.

CloseAsync(TWebSocketCloseStatus,String,_CancellationToken)

Close the TCnClientWebSocket instance as an asynchronous operation.

CloseOutputAsync(TWebSocketCloseStatus,String,_CancellationToken)

Close the output for the TCnClientWebSocket instance as an asynchronous operation.

Connect

Connect to a WebSocket server.

ConnectAsync

Overloaded. Connect to a WebSocket server as an asynchronous operation.

ConnectAsync(String,_CancellationToken)

Overloaded. Connect to a WebSocket server as an asynchronous operation.

ConnectAsync(_Uri,_CancellationToken)

Overloaded. Connect to a WebSocket server as an asynchronous operation.

Dispose

Releases the unmanaged resources used by the TCnClientWebSocket instance.

DoGetDefaultClrObject

Represents method DoGetDefaultClrObject. (Overrides TClrBaseComponent.DoGetDefaultClrObject.)

DoGetDotNetBaseComponent

Represents method DoGetDotNetBaseComponent. (Overrides TClrBaseComponent.DoGetDotNetBaseComponent.)

GetClrObject

Represents method GetClrObject. (Inherited from TClrBaseComponent.)

Receive

Overloaded. Receive data on TCnClientWebSocket as a synchronous operation and return .Net array of Bytes.

ReceiveA

Overloaded. Receive data on TCnClientWebSocket as a synchronous operation and returns Delphi array of Bytes.

ReceiveAsync(TArray,_CancellationToken)

Overloaded. Receive data on TCnClientWebSocket as an asynchronous operation.

ReceiveAsync(_ByteArray,_CancellationToken)

Overloaded. Receive data on TCnClientWebSocket as an asynchronous operation.

ReceiveAsync(_GenericArraySegment,_CancellationToken)

Overloaded. Receive data on TCnClientWebSocket as an asynchronous operation.

RegisterEventCallBack(ClrWString,Pointer)

Add an event to the instance using the specified event name and function pointer which is the event handler. The RegisterEventCallBack method does not directly add the event handler to the event. A hooking mechanism is used such that if the event is fired, the hook event is also fired which in turn calls the function pointer. (Inherited from TClrBaseComponent.)

RegisterEventSource

Register the Delphi object which will raise the .Net event handler. (Inherited from TClrBaseComponent.)

Send(TArray,Boolean)

Overloaded. Send data on TCnClientWebSocket as a synchronous operation.

Send(_ByteArray,Boolean)

Overloaded. Send data on TCnClientWebSocket as a synchronous operation.

SendAsync(_GenericArraySegment,TWebSocketMessageType,Boolean,_CancellationToken)

Send data on TCnClientWebSocket as an asynchronous operation.

UnRegisterEventCallBack(ClrWString,Pointer)

Remove an event from the instance using the specified event name and function pointer which is the event handler. (Inherited from TClrBaseComponent.)

UnRegisterEventSource

Unregister the Delphi object which raised the .Net event handler. (Inherited from TClrBaseComponent.)

Top

See C:\Users\Public\Documents\CrystalNet Technologies\.Net VCL for Delphi Demo Folder after installation for examples of how to use this component.