IPWorks MQ 2020 Android Edition

Questions / Feedback?

AzureRelayConnection Type

A currently connected client.

Remarks

This type describes the connection of a client which is currently connected to the component. You may use the different fields of this type to manage the connection.

Fields

AcceptData
boolean

Setting this field to False, temporarily disables data reception (and the ConnectionDataIn event) on the connection. Setting this to True, re-enables data reception.

Address
String

This field holds the rendezvous URL to which the connection specific websocket connection will be made. This is for information only, no action needs to be taken based on this value. For instance: wss://g21-prod-by3-003-sb.servicebus.windows.net/$hc/hc1?sb-hc-action=accept&sb-hc-id=2d4acb89-7d15-4aeb-bcd5-66e031580a90_G21_G1

BytesSent
int

This field shows how many bytes were sent after the last assignment to DataToSend. Please check DataToSend for more information.

Note that this field will always return 0 when the component is operating in synchronous mode (that is, the Timeout property is set to a positive value.)

Connected
boolean

This field is used to disconnect individual connections and/or show their status.

The Connected field may be set to false to close the connection.

Connected also shows the status of a particular connection (connected/disconnected).

ConnectHeaders
String

A JSON object containing the HTTP headers that have been supplied by the sender to the Azure Relay service. For instance:


"connectHeaders": {
	"Sec-WebSocket-Key": "QocLBwK5J40Qp35L2duoBg==",
	"Sec-WebSocket-Version": "13",
	"Origin": "null",
	"Connection": "Upgrade",
	"Upgrade": "websocket",
	"Accept-Encoding": "gzip, deflate",
	"Host": "nstest.servicebus.windows.net",
	"User-Agent": "IPWorks HTTP Component - www.nsoftware.com"
}

ConnectionId
String

This field contains an identifier generated by the component to identify each connection. This identifier is unique to this connection.

DataFormat
int

The format of the data being sent. When data is sent over an established connection it is either considered as text or binary data. Text data is UTF-8 encoded. Binary data has no encoding associated with it.

Possible values are:

0 (dfAutomatic - default) The component will attempt to automatically determine the correct data format. This is suitable for most cases.
1 (dfText) The component will UTF-8 encode the specified data before sending. Data that has already been UTF-8 encoded may also be supplied.
2 (dfBinary) The component will send the data exactly as it is provided.
9 (dfPing) The component will send the ping with data exactly as it is provided.
10 (dfPong) The component will send the pong with data exactly as it is provided.

DataToSend
String

This field contains a string of data to be sent to the remote host. Write-only property.

Assigning a string to the DataToSend makes the component send the string to the remote host. The Send method provides similar functionality.

If you are sending data to the remote host faster than it can process it, or faster than the network's bandwidth allows, the outgoing queue might fill up. When this happens, DataToSend fails with exception 10035: "[10035] Operation would block" (WSAEWOULDBLOCK). You can check this error, and then try to send the data again. The BytesSent property shows how many bytes were sent (if any). If 0 bytes were sent, then you can wait for the ReadyToSend event before attempting to send data again. (However, please note that ReadyToSend is not fired when part of the data is successfully sent).

DataToSendB
byte []

This field contains a string of data to be sent to the remote host. Write-only property.

Assigning a string to the DataToSend makes the component send the string to the remote host. The Send method provides similar functionality.

If you are sending data to the remote host faster than it can process it, or faster than the network's bandwidth allows, the outgoing queue might fill up. When this happens, DataToSend fails with exception 10035: "[10035] Operation would block" (WSAEWOULDBLOCK). You can check this error, and then try to send the data again. The BytesSent property shows how many bytes were sent (if any). If 0 bytes were sent, then you can wait for the ReadyToSend event before attempting to send data again. (However, please note that ReadyToSend is not fired when part of the data is successfully sent).

Extensions
String

The WebSocket extensions sent by the client in the initial WebSocket connection request.

Host
String

The Host header value of the connected client.

Id
String

This field holds the Id of the connection. If an Id was specified by the client it is present here, otherwise the Azure Relay service generates a value. For instance: 2d4acb89-7d15-4aeb-bcd5-66e031580a90_G21_G1.

ReadyToSend
boolean

Indicates whether the component is ready to send data.

This field indicates that the underlying TCP/IP subsystem is ready to accept data. This is True after a client connects, and will become False after a failed DataToSend.

After a failed DataToSend the ReadyToSend event will fire and this field will be True when data can be sent again.

RemoteAddress
String

This field holds the IP address of the connecting client.

RemotePort
int

This field holds the port of the connecting client.

SubProtocols
String

The subprotocols (application-level protocols layered over the WebSocket Protocol) sent by the client in the initial WebSocket connection request.

Timeout
int

This field specifies a timeout for the component.

This field defines the timeout when sending data. If the Timeout field is set to 0, all operations will run uninterrupted until successful completion or an error condition is encountered.

If Timeout is set to a positive value, the component will wait for the operation to complete before returning control.

The component will use DoEvents to enter an efficient wait loop during any potential waiting period, making sure that all system events are processed immediately as they arrive. This ensures that the host application does not "freeze" and remains responsive.

If Timeout expires, and the operation is not yet complete, the component throws an exception.

Please note that by default, all timeouts are inactivity timeouts, i.e. the timeout period is extended by Timeout seconds when any amount of data is successfully sent or received.

The default value for the Timeout field is 0.

UploadStream
java.io.InputStream

Setting this field uploads the data in the specified stream to the current connection. The component will automatically close this stream if CloseStreamAfterTransfer is true (default).

Constructors

public AzureRelayConnection();



Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks MQ 2020 Android Edition - Version 20.0 [Build 8155]