Realtime Chat Application with Delphi and SignalR Using Devart SecureBridge - CodeRage 2019

Realtime Chat Application with Delphi and SignalR Using Devart SecureBridge - CodeRage 2019


In this video, we'll create a simple real-time multi-platform chat application in RAD Studio using Devart SecureBridge component called TScHubConnection, which implements the functionality of a SignalR client.

** Learn More: http://www.devart.com
** CodeRage Live Tech Partner Q&A: https://youtu.be/8XlFljU2NTQ
** Full Tech Partner Playlist: https://embt.co/CodeRage2019Wk5
** https://embarcadero.com
Closed Caption:

in this video we'll create a simple
real-time multi-platform chat
application in rad studio using dev arts
secure bridge component called TS c hub
connection which implements the
functionality of a signal art client
signal R is a client-server
communication protocol then adds
real-time functionality to desktop and
web apps the server will be able to push
content to connected clients as soon as
it becomes available without waiting for
the client to request data signal our
client have been implemented in many
languages but the Delfy community lacked
such a library so we a dev art decided
to implement a signal art client in
secure bridge a security component
library for Delfy
besides secure bridge dev art offers a
wide range of software solutions such as
reliable Delfy data access components
for popular databases and cloud sources
and advanced Delfy o our M tool entity
DAC
for all conference attendees we offer a
20% off Delfy data access components
entity DAC or secure bridge purchase
to claim the offer enter the code rage
19 coupon code on the product ordering
page
let's start by creating a new multi
device application our form will have a
few panels one at the top and one at the
bottom we'll also add a team memo
component which is our main chat area
where messages are displayed now add a
teaspoon or component to the form which
will allow us to resize the panels at
runtime add a tea list box to display a
list of users to chat with
ad t label components for the user name
and message fields
a dati edit component that will contain
the name of the user that we're
currently chatting with
at 'edit component that will hold our
username at another t edit component
where we'll type our message
at a button that connects to the server
and a button for sending our message
place the TSC hub connection component
on the form
let's switch to the unit view and
declare public methods do message
receipt do user connected and do user
disconnected for receiving messages
establishing a connection and dropping
the connection to the server will also
declare private methods fill user
nameless fill message list connect
disconnect and is connected which are
explained further
ad system dot Jason to the uses clause
since we're going to use Jason to send
and receive messages from the server
implement the fill username list method
the parses a json array received from
the server and updates the list of
connected users in the T list box
component on the form
now let's write code for the fill list
method in parses a json array and
updates the list of messages in the t
memo component in the do user connected
event handler we invoke the fill user
nameless and fill message list methods
the do message recede eventhandler
displays new messages in the chat area
the do user disconnected event handler
invokes the fill username list method to
update the list of connected users when
we disconnect from the server
the connect method invokes the start
register and send methods of the TSE hub
connection component the start method
establishes a connection to the server
the register method registers a handler
that will be invoked when the hub method
with the specified method name is
invoked and the send method invokes a
hub method on the server using the
specified method name and arguments
the text property of the BT connect
button changes to disconnect after the
connection has been successfully
established
the disconnect method invokes the send
and stop methods of secure bridge the
stop method drops the connection to the
server the text value of the BT connect
button is changed to connect and the
username list is cleared
is conected method stores the state of
the connection to the server
implement the on destroy event handler
that drops an active connection to the
server before destroying the form when
we close our application
now let's implement the Beatty Connect
click event handler then is triggered
when we click the button
[Music]
whether the client is connected to the
server if the is connect function
returns true the client drops the
connection to the server by executing
the disconnect method in case of false
the event handler triggers the execution
of the connect method to establish a
connection to the server also it checks
whether we've specified our username in
the nickname field
[Music]
[Music]
finally assign the server address to the
URL property of the TSE hub connection
component on the form
now let's run a rap on various platforms
and see how it works secure bridge also
offers Delfy clients and servers for ssh
ssl HTTP HTTP WebSocket and other
protocols visit the dev art site for
more details on secure bridge and other
Delfy component libraries
[Music]

Video Length: 07:31
Uploaded By: Embarcadero Technologies
Published: 1/8/2020
View Count: 9,302

Related Software Products
SecureBridge
SecureBridge

Published By:
Devart

Description:
SecureBridge: SSH, SFTP and TLS Components for Delphi With No OpenSSL DLLs to Ship SecureBridge is a Devart component library that adds SSH, SFTP, FTPS, TLS, HTTPS, WebSocket and SignalR to applications built with Delphi, C++Builder and Lazarus. It costs $199.95 at checkout for one developer on the Professional edition, or $99.95 for the client-only, Windows-only Standard edition. You reach for it when your Delphi application has to fetch a file...


Related Videos
Easiest customizable HTTPS client from SecureBridge
Easiest customizable HTTPS client from SecureBridge

Video Length: 24:22
Uploaded By: Devart (12/27/2018)
View Count: 1,622

Copyright © 2026, Ivertech. All rights reserved.