uniGUI Live Demo

.

WebSockets is a relatively new technology which enables full-duplex communication in web sites or web applications. A standard web application uses HTTP protocol which is a half-duplex communication protocol. Server always is in listen mode and serves incoming requests from the clients. In the conventional HTTP protocol there is no way for the server to directly send data to the clients. In order to update the client view in the browser, client should continuously ask the server and get the new updates if there are any. This method is called polling the server. Polling is normally done using a JavaScript timer which regularly sends Ajax requests to the server. If there are any new updates the data is sent back to the client.

 There are some disadvantages to use polling method:

Clients should continuously send Ajax requests to server which means server needs to handle a huge number of Ajax requests if there are too many clients.

Updates can only occur when there is an Ajax request. There is no way to update the client asynchronously. For example, if timer is set to fire each 30 seconds, client updates can only occur at 30 second intervals.

In order to overcome this limitation WebSocket technology was introduced about 10 years ago. Actually, WebSocket is not a new technology. Basically, it is just another TCP channel opened between client and the server. Unlike HTTP protocol where TCP connections can be temporary, a WebSocket connection is always open and ready to send & receive data. Client browser is able to receive messages from server through a WebSocket connection. It will enable server to send instant messages to the clients so polling mechanisms no longer will be needed.

uniGUI integrates WebSockets technology to enable developers send messages directly to web clients from the server. uniGUI implementation of WebSockets technology is very straightforward. Sending messages from server to clients can be done by using a method named BroadcastMessage(). When this method is called a message and related parameters will be broadcast through uniGUI network using WebSocket channels. This broadcast will include all Nodes and slave servers in a server farm cluster. uniGUI automatically relays the messages to all server instances which are active in a server farm cluster. Each server sends the messages to its own web clients. So no matter how complicated is your server farm cluster, uniGUI will ensure that all sessions will receive the messages.

For example using below syntax a message named 'update' will be sent to all existing clients.

BroadcastMessage('update');

 When this message is received by a web client, that client fires an Ajax request to the server. Consequently on server side an event handler named OnBroadcastMessage will be called:

procedure TMainForm.UniFormBroadcastMessage(const Sender: TComponent;  const Msg: string;
                                            const Params: TUniStrings);
begin
  if Msg = 'update' then
  begin
    UniLabel1.Caption := Query1.RecordCount.ToString;
  end;   
end;

In above example a UniLabel is updated each time a message is received. It is updated to show current record count of a database query.

The message is sent from server side and immediately reaches all the active sessions. Source of the message can be almost anywhere. It can be a user event or any other thread in the system. Evidently, messages can be sent asynchronously from any thread in the application. It is possible to use a thread timer to broadcast messages in regular time intervals. In a HyperServer cluster a message which is initiated from a Node will be propagated through all the servers in the cluster. It will be done automatically by the HyperServer no matter how big or complicated your cluster structure is.

Live Examples!

Below are few live examples running inside frames. Each frame contains a uniGUI web application session.

Chat Demo

On top two frames we have a simple chat application using WebSockets to instantly transferring chat messages to all existing sessions. You can simply test it by typing something in the related field and pressing the Send button. You will notice that the message is immediately transferred to the other frame running the chat application. You can also open new instances of this web page in new browser tabs and observe that chat messages are delivered to all chat session in open browser tabs.

If we examine chat application we can see that how simple is the underlying code. In below code chat message is sent to rest of the clients using the BroadcastMessage method.

procedure TMainForm.UniButton1Click(Sender: TObject);
var
  Msg, Nick : string;
begin
  Msg := Trim(UniEdit1.Text);
  if Msg <> '' then
  begin
    Nick := Trim(UniComboBox1.Text);
    // update my memo
    AddLine(Msg, Nick);

    // update other sessions' memos
    BroadcastMessage('chat',
                      [
                        'msg', Msg,
                        'nick', Nick
                      ],
    [boIgnoreCurrentSession]); // Send the message to other sessions only                
  end;
  ActiveControl := UniEdit1;
end;

The chat message is broadcasted by server to all existing web sessions using WebSocket connections. When a web clients receives a WebSocket message it casts an Ajax event to the server which will be handled in a Delphi event handler as below:

procedure TMainForm.UniFormBroadcastMessage(const Sender: TComponent;
                                            const Msg: string;
                                            const Params: TUniStrings);
begin
  if Msg = 'chat' then
    AddLine(Params['msg'].AsString, Params['nick'].AsString);
end;

 

Client Update Demos

In uniGUI implementation of WebSockets there is a possibility to update web clients directly without a need to send Ajax requests to the server. In this scenario server sends data to all sessions (or selected sessions) using a WebSocket connections. When clients receive this data a client side JavaScript handler is called to notify the client. An event handler can be used to update client side UI elements directly.

In one of the frames there is a uniGUI application showing a Label continuously refreshed with current time and date. Looking at the underlying code reveals that there is a thread timer on server side which broadcasts current date and time to all sessions.

procedure TUniServerModule.UniThreadTimer1Timer(Sender: TObject);
begin
  BroadcastMessage('update',
                  [
                    'value', FormatDateTime('dd/mm/yyyy hh:nn:ss', Now)
                  ],
                  [boClientOnly]);
end;

On the client side there is a JavaScript event handler which is responsible to get server side data and update the screen label. This method eliminates the need to send an Ajax request to the server to update the label. Label is directly updated in the client side JavaScript code. If you notice there is an option in above code named boClientOnly. This means that WinSocket message should be processed on the client side and it won't fire an Ajax request.

function form.socketmessage(sender, msg, params, eOpts)
{
   if (msg == 'update') {
      MainForm.UniLabel1.setText(params.value);
   }
}

In the other frames there is another uniGUI application showing a grid continuously refreshed with random data from the server. It uses same principle as the previous example. There is a thread timer on server side which broadcasts an array with randomly generated data:

procedure TUniServerModule.UniThreadTimer1Timer(Sender: TObject);
var
  ParamArr : TConstArray;
  I, J : Integer;
begin
  InitConstArray(ParamArr);
  try
    for I := 1 to GRD_ROW do
      for J := 1 to GRD_COL do
        AddToConstArray(ParamArr, [Format('%d_%d', [I, J]), Random(1000)] );

    BroadcastMessage('update_grid', ParamArr, [boClientOnly]); // Message will be processed on client side event handler
  finally
    FreeConstArray(ParamArr); // This must be called to free array elements otherwise memory leak will occur
  end;
end;

As expected on the client side there's a JavaScript method which updates grid cells with received data:

function form.socketmessage(sender, msg, params, eOpts)
{
   if (msg == 'update_grid') {
      var grd = MainForm.UniStringGrid1;
      for (prop in params) {
         arr = prop.split('_');
         var row = grd.store.getAt(arr[0]); // row number
         if (row) {
            row.set(arr[1], params[prop]);
         }
      }
   }
}

Please note that directly updating the client UI is an optional feature. It is not needed to use WebSockets functionality. Most applications just do fine by updating UI in a server side Ajax request as demonstrated in the chat demo application above. Directly updating the UI is needed when you want make fast and continuous updates to the UI and don't want to create additional Ajax traffic. It helps updating UI directly from the server with little overhead and avoids creating unnecessary Ajax traffic where applicable.

 

Currently there are three editions available for uniGUI:

uniGUI Personal Edition

This edition is considered to be suitable for small business and intranet/internet web application projects where number of concurrent users are small and predictable. uniGUI Personal Edition is a good starting point for free lance developers and small business. It provides two deployment methods: Standalone Server and Windows Service. In this edition there is an upper limit of 30 concurrent sessions which means no more than 30 sessions can be active at the same time. This edition doesn't include any source code. Deployment is limited to 32-bit applications only. Please see Feature Matrix below for more details. This edition includes one year subscription to all minor and major updates.

 

uniGUI Professional Edition

This edition includes all features available in Personal Edition. Additional to those features Professional edition doesn't enforce any limitation on number of concurrent sessions. It also allows ISAPI DLL deployment to Microsoft IIS and Apache for Windows web servers. Deployment is available for both 32-bit and 64-bit applications. This edition includes 10 additional visual themes for desktop web applications. Source code for components2 are included. Please see Feature Matrix below for more details. This edition also includes uniGUI HyperServer.

 

uniGUI Complete Edition

This edition includes all features available in Professional Edition. Additional to those features Complete edition includes a set of special components for mobile devices. These components are designed and optimized specially for touch based mobile devices such as tablet and smartphones. A demonstration for uniGUI mobile components is available here. Please see Feature Matrix below for more details.

 

Feature Matrix

  Personal Professional Complete Trial¹
Features
Windows 64-Bit
No Yes Yes No
Linux 64-Bit (Delphi 10.3 and Later) No Yes Yes No
Additional Themes No Yes Yes No
Source Code No Core & Components2 Core & Components2 No
Mobile Components No No Yes Yes
HyperServer No Yes Yes No
One Year Subscription4 Yes Yes Yes -
Deployment Options
Standalone Exe Yes Yes Yes Yes
Windows Service Yes Yes Yes Yes
ISAPI DLL No Yes Yes Yes
Native Apache 2.4 No Yes Yes Yes
Limitations
Maximum Concurrent Sessions 30 Unlimited5 Unlimited5 Unlimited5
Session Time Limit3 - - - 5 Minutes
Pricing
New User Price4 395 USD 680 USD 890 USD Free

 

1 Trial edition has additional limitations. Please visit here for details.

2 Pro edition includes source code for uniGUI Core and Components. Please see topic Source Code Availability for details.

3 Session Time Limit applies to trial edition only. In trial edition sessions will be forcefully terminated after 3 minutes.

4 Subscription renewal prices are around 60% of the New User Price.

5 Actual maximum number of concurrent sessions is limited by system resources, application design, database engine and other factors.

Related:

uniGUI Licensing.

  • What is uniGUI?

    uniGUI is a Web Application Framework for Delphi. C++ Builder development is also supported for RAD Studio

    Read More
    Technology Overview

    uniGUI framework makes developing Web applications easier than ever. uniGUI extends Web Application development experience to a new dimension

    Read More
    uniGUI HyperServer

    uniGUI HyperServer is a new server archirecture designed to highly improve uniGUI applications

    Read More
    uniGUI Editions

    Currently there are three editions available for uniGUI: Personal, Professional and Complete

    Read More
    Component List

    you can find a list of all available components in uniGUI framework

    Read More
    Feature Matrix

    Each uniGUI edition supports a different set of features which can be examined by looking at the feature matrix

    Read More
    Licensing

    uniGUI is distributed with a named license which means each developer in a company

    Read More
    Download

    uniGUI Trial Edition is a special build to allow developers fully test and experience uniGUI Web Application development

    Read More
    WebSockets

    uniGUI integrates WebSockets technology to enable developers send messages directly to web clients from the server

    Read More
  • Multiple Menu Options

    Navigation is a fundamental pillar of any website as well as the template, and Epsilon offers several configurable options to best suit your navigational preferences, for both desktop and mobile device types.

    Dropdown

    CSS based menu system with multiple columns and other advanced per menu items options.

    SplitMenu

    A static menu that displays parent items in the header and child items in the sidebar, as configurable.

    Panel

    A mobile responsive menu that displays all items in a column structure, slidable from the side via a toggle.

    Extended

    Extended menu provides options for menu items columns along and additional child elements.

  • Free GPL Template Framework

    Gantry is a powerful core framework, that sits at the heart of Epsilon, providing the foundation for the major, standarized features and functions, such as the rich and intuitive, custom template manager interface.

    Grids

    Gantry allows for module positions to be split into configuration grids on a per menu item basis.

    SCSS CSS

    The SCSS compiler is built into Gantry, an extended CSS language that allows for easier development.

    Outlines

    Custom module layouts and positions, as well as per-page template outlines are available.

    Options

    A custom administrative interface in the template manager allows for swift configuration.

  • Diverse Element Styling

    The template has a rich assortment of styled elements, ranging from custom typography to configurable preset style variations, and a flexible selection of stylistic and structural module class suffixes.

    Presets

    A selection of six, diverse preset style variations, with numerous available customization options.

    Module Style

    Choose from eight compoundable module class suffixes to adjust title and/or full module styling.

    Module Layout

    An array of structural suffixes are available to individually adjust padding, margins and font formats.

    Typography

    A diverse inventory of typography from Bootstrap as well as FontAwesome, to enrich content.

Latest Posts

  • We have renewed our Customer Portal
    We are happy to introduce our renewed customer portal. Now it adopts a modern UI with frames embedded in tab pages. There are various changes and improvement here and there. We will continue improving customer portal and add new features.
    Written on Tuesday, 17 March 2026 10:12 Read 1202 times
  • uniGUI 2.0 roadmap is announced
    We are happy to announce our new roadmap. For full article please visit below link: uniGUI Roadmap 2026 (Q2 - Q4)
    Written on Tuesday, 17 March 2026 10:08 Read 1415 times
  • New installer has arrived!
    We are glad to announce that the new generation of our uniGUI installer is eventually available. As you may already know, our original installer was a "semi-automatic" installer, meaning that developers were responsible to manually build uniGUI packages after installing uniGUI framework. While this method of installation served us well…
    Written on Wednesday, 02 July 2025 07:30 Read 7179 times
  • New 2024 roadmap is announced
    We are happy to announce our new roadmap. For full article please visit below link: uniGUI Roadmap 2024 (Q1 & Q2)
    Written on Wednesday, 21 February 2024 08:08 Read 11696 times
More Posts   >>