ThingWorx Edge .NET SDK > ThingWorx Edge .NET SDK Reference > .NET SDK: ClientConfigurator Class
.NET SDK: ClientConfigurator Class
The ClientConfigurator class contains settings that the ConnectedThingClient uses to connect to the ThingWorx platform and control its behavior. It also contains configuration options used for the following subsystems:
File Transfer
Proxy Servers
Client/Server Certificate validation
X.509 Field validation
Duty Cycle modulation
Offline Message Storage
Properties of the ClientConfigurator Class
The following properties are available on the ClientConfigurator class:
AllowSelfSignedCertificates(Boolean) — Set to true to accept self-signed certificates. This setting is strongly discouraged for a production environment.
AutoReconnect(Boolean) — Set to true if it is desired to automatically reconnect to the ThingWorx platform if a connection is lost.
Claims(String value) — Sets the security settings used by the ConnectedThingClient for connecting to a ThingWorx platform. The Claims object provides the following methods:
addClaim(String name, String value) — If the security claim is well known, this method can be called to pass in the appropriate value. For example:
// Application Key Example
SecurityClaims claims = new SecurityClaims()
fromAppKey(String appkey) — This is the preferred method of obtaining a SecurityClaims object. This method returns a SecurityClaims object whose security is based on an Application Key. The appkey value is the keyId of an Application Key, which is a unique identifier in the form: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. To obtain this value, an administrator creates an Application Key usingThingWorx Composer. Copy the value of its keyId field. For example:
SecurityClaims claims = SecurityClaims.fromAppKey(
ConnectRetries(String value) — Number of retries used to establish a WebSocket connect. The Connect call returns an error after the retries are exhausted.
ConnectTimeout(String value) — Time to wait for the WebSocket connection to be established. Measured in milliseconds.
DisableCertValidation(Boolean) — Set to true to notify the TLS library to not validate the server certificate.
ForceConnectOnFireEvent(Boolean) — When in the disconnected state of the duty cycle, force a reconnect to send the message.
ForceConnectOnInvokeService(Boolean) — When in the disconnected state of the duty cycle, force a reconnect to send the message.
ForceConnectOnReadProperty(Boolean) — When in the disconnected state of the duty cycle, force a reconnect to send the message.
ForceConnectOnWriteProperty(Boolean) — When in the disconnected state of the duty cycle, force a reconnect to send the message.
IdlePingRate(String value) — WebSocket keep alive rate. Used to ensure the connection stays open. Measured in seconds. This value should never be greater than the ThingWorx platform side setting, which defaults to 60 seconds.
MaxConnectDelay(String value) — Maximum delay before connecting. Measured in milliseconds.
MaxMessages(String value) — Maximum number of messages that have not been processed in the message queue.
MaxMessageSize(String value) — The maximum size of a complete message whether it is broken up as a multipart message or not. Messages larger than this will be rejected. Measured in bytes.
MessageChunkSize(String value) — The maximum size of a message chunk. Messages large than this will be broken up into a multipart message. Measured in bytes. This value should be the same as the ThingWorx platform side configuration which defaults to 8192.
MessageFrameSize(String value) — The maximum size of a message frame.
MessageTimeout(String value) — Time to wait for a response to a message from the ThingWorx platform. Measured in milliseconds.
Name(String value) — The name of the client.
PongTimeout(String value) — Time to wait for a response to a ping message from the ThingWorx platform. Measured in milliseconds.
ReconnectInterval(String value) — Connection retry interval. Measured in seconds.
setType(String value) — The type of the client.
SocketReadTimeout(String value) — Socket read timeout.
StaleMsgCleanupRate — Periodic cleanup rate for multipart messages that never receive all of the expected number of message chunks. Measured in milliseconds.
StreamBlockSize — Incremental block size for dynamically allocated stream (byte array) variables. When adding bytes to a stream, this is the size of memory allocated if more memory is needed.
Uri(String uri) — Sets the URI that is used for connecting to the ThingWorx platform. This URI is in the following form:
Secure WebSockets: wss://<server>:<port>/ThingWorx/WS
Where <server> is the IP address or domain name of the ThingWorx platform and <port> is the port that the ThingWorx platform is listening on.
To learn how to bind entities to ThingWorx, see ConnectedThingClient Methods..