How to implement notification for a Windows application using .NET

I need to implement an application based on a client server, where the client is a Windows application. Now I plan to create a web service as a server application and use it in our client application. But the problem is the notification. To do this, I need to add a timer to the client application to check the notification. This slows down the client application.

What is the best way to do this?

I need to create an installation for both applications. Therefore, the solution must be deployed.

Edit: I cannot put a timer in a background or separate thread because I need to update the datagridview immediately.

+3
source share
5 answers

If you use WCF, you may need to consider Duplex Services.

A duplex service contract is a message exchange template in which both endpoints can send messages to the other independently. A duplex service, therefore, can send messages back to the client endpoint providing an event-like behavior. Duplex communication occurs when a client connects to a service and provides a service with a channel on which the service can send messages back to the client. Note that the duplex service behavior event only works for the duration of the session.

therefore, this avoids the timer problem.

Some links deserve attention

0

BackgroundWorker Threadpool.QueueUserWorkItem -, . , - , , - , , , ...

: http://msdn.microsoft.com/en-us/library/ms951089.aspx

, ? , , .

XXX .

BeginUpdate EndUpdate , .

+1

" - ". , , - -, - .

? , -, , (, , , , ).

0

, " "? , , ?

0

, . , InvokeRequired BeginInvoke . BeginInvoke . . BeginInvoke? . , , BeginUpdate EndUpdate DataGridView.

0

Source: https://habr.com/ru/post/1733312/


All Articles