BlogAll Blog Posts | Next Post | Previous Post
Thursday, October 27, 2022
Today a new member joins the TMS FNC family: TMS FNC WebSocket!
In TMS FNC WebSocket you'll find easy to use server and client components for WebSocket communication. Both the server and the client implement the RTF 6455 standard for WebSocket Protocol, so the components can be mixed and used with existing WebSocket clients and servers.
Simply drop them on a form, set the few required properties such as port number and host name and they are ready to connect. Of course, starting up a server that does nothing or connecting to a server without doing anything with the incoming messages is rarely enough so let's take a look at the capabilities!
Receiving and sending messages as one would expect is possible. There are separate events and methods available for text and binary data based messages. You can also broadcast a message to all connected clients or decide yourself which clients should receive the message.
But is it secure? Yes, the TTMSFNCWebSocketServer also supports the WebSocket Protocol over TLS!
Not only the server needs to be able to send and receive messages but also the client. Just like in TTMSFNCWebSocketServer, separate events and methods are available for dealing with text and binary messages. Sending a text message to the server is as simple as:
We also made sure to make TTMSFNCWebSocketClient as compatible with the existing TWebSocketClient component (TMS WEB Core) as possible so you can reuse your existing code without headaches!
Along with our new TMS FNC Cloud Pack v2.5 release we added support for sending WhatsApp messages. What about receiving messages?
The WhatsApp Business API requires a webhook to receive messages. Utilizing the power of TTMSFNCWebSocketServer, the TTMSFNCWhatsAppServer allows you to run a server that serves as the callback URL for the WhatsApp Business API. This makes it possible to catch the incoming messages that you are subscribed to.
You can either parse the incoming JSON messages yourself or take advantage of the TTMSFNCWhatsAppServer forwarding these messages for you to the connected TTMSFNCWhatsAppReceiver clients! The TTMSFNCWhatsAppReceiver will do the parsing for you resulting in an object that contains all the message details, such as sender name, phone number, message id, and so on...
WebSockets in action
Can't wait to see WebSockets working in native and WEB environments? Watch this video we prepared for the launch!
This blog post has received 9 comments.
All Blog Posts | Next Post | Previous Post