ASP.NET Core SignalR is an open-source library that simplifies adding real-time web functionality to apps. Real-time web functionality enables server-side code to push content to clients instantly.
Good candidates for SignalR:
SignalR Core sgcWebSockets component uses WebSocket as transport to connect to a SignalR Core server, if this transport is not supported, an error will be raised.
SignalRCore.Invoke('SendMessage', ['John', 'Hello All.'], 'id-000001'); procedure OnSignalRCoreCompletion(Sender: TObject; Completion: TSignalRCore_Completion); begin if Completion.Error <> '' then ShowMessage('Something goes wrong.') else ShowMessage('Invocation Successful!'); end;
Invocations: the Caller sends a message to the Callee and expects a message indicating that the invocation has been completed and optionally a result of the invocation
Example: client invokes SendMessage method and passes as parameters user name and text message. Sends an Invocation Id to get a result message from the server.
SignalRCore.Invoke('SendMessage', ['John', 'Hello All.']);
Non-Blocking Invocations: the Caller sends a message to the Callee and does not expect any further messages for this invocation. Invocations can be sent without an Invocation ID value. This indicates that the invocation is "non-blocking".
Example: client invokes SendMessage method and passes as parameters user name and text message. The client doesn't expect any response from the server about the result of the invocation.
SignalRCore.InvokeStream('Counter', [10, 500], 'id-000002'); procedure OnSignalRCoreStreamItem(Sender: TObject; StreamItem: TSignalRCore_StreamItem; var Cancel: Boolean); begin DoLog('#stream item: ' + StreamItem.Item); end; procedure OnSignalRCoreCompletion(Sender: TObject; Completion: TSignalRCore_Completion); begin if Completion.Error <> '' then ShowMessage('Something goes wrong.') else ShowMessage('Invocation Successful!'); end;
Streaming Invocations: the Caller sends a message to the Callee and expects one or more results returned by the Callee followed by a message indicating the end of invocation.
Example: client invokes Counter method and requests 10 numbers with an interval of 500 milliseconds.
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.