We use cookies
We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.
sgcWebSockets is a complete package providing access to WebSockets protocol, allowing to create WebSockets Servers and Clients for Delphi and CBuilder Projects.
Several Protocols and APIs are also supported.
MQTT is a Client Server publish/subscribe messaging transport protocol. It is light weight, open, simple, and designed so as to be easy to implement. These characteristics make it ideal for use in many situations, including constrained environments such as for communication in Machine to Machine (M2M) and Internet of Things (IoT) contexts where a small code footprint is required and/or network bandwidth is at a premium.
The MQTT messages are delivered asynchronously (“push”) through publish subscribe architecture.
MQTT control packet headers are kept as small as possible.
Three QoS for message delivery could be achieved using MQTT
When a MQTT client connects to the MQTT server it can define a topic and a message that needs to be published automatically on that topic when it unexpectedly disconnects
Component supports MQTT 3.1.1 protocol and latest 5.0 protocol.
Full compliant MQTT Client Component for Delphi, CBuilder and .NET.
Following features are implemented
Code Examples for MQTT Client.
// Create websocket client and set server options
oClient := TsgcWebSocketClient.Create(nil);
oClient.Host := 'www.esegece.com';
oClient.Port := 15675;
oClient.Options.Parameters := '/ws';
// Create MQTT protocol and assign to websocket client
oMQTT := TsgcWSPClient_MQTT.Create(nil);
oMQTT.Client := oClient;
// MQTT Authentication
oMQTT.Authentication.Enabled := True;
oMQTT.Authentication.Username := 'sgc';
oMQTT.Authentication.Password := 'sgc';
// Handle MQTT methods
oMQTT.OnMQTTConnect := OnMQTTConnectHandler;
oMQTT.OnMQTTDisconnect := OnMQTTDisconnectHandler;
// connect to server
oClient.Active := True;
// Subscribe to channel "myTopic"
oMQTT.Subscribe('myTopic');
// Send a message to all subscribers of channel "myTopic"
oMQTT.Publish('myTopic', 'Text message');
// Send a ping to Server
oMQTT.Ping;
We would love to hear about your projects. Got a question? Drop us a mail.
eSeGeCe
Barcelona
Spain (Europe)