The web is a powerful platform! This statement is not new in 2019, but it is constantly evolving and giving developers new and creative ways to reach the end user.
This demo will highlight a 4D component that provides Web Socket communication from within 4D to a web client (Chrome/Safari/Firefox/Edge/etc). Web Sockets are a (semi-) new way to keep a connection open with a web client to the server for real-time communication.
Usually when a browser visits your web application, it downloads the necessary assets and files then disconnects. Web Sockets give you the ability keep that connection open and PUSH or PULL data from either direction. A simple example can be a web dashboard with live data being pushed as it changes on the server in real time without the need for “polling” constantly from the client. There are so many use-cases for this way of communicating.
Specifically, Web Sockets are not a replacement for AJAX calls. (…but could be depending on how you intend to use them!) They are meant for a different purpose where you need real-time syncing or pushing data from the server to your clients.
mdWebSockets is a shareware component created to serve Web Sockets right out of 4D that follows a similar concept of the 4D commands “Register Client” and “Execute on Client.” The component has a server methodology set of commands to start/stop the server, listen on a specific port and keep spinning up processes as connections come in. The component itself will be free to download and connect up to 2 web sockets without a license. Purchasing a server license will unlock the connection to an unlimited amount of web clients.
To be able to ask questions directly via video chat in the hangout, connect with this link.
!!! Check back to this page around meeting time for an updated link.
Or stream directly on YouTube: