Solved

Sending notification commands to Windows Forms application over a network

Posted on 2011-09-04
7
572 Views
Last Modified: 2012-05-12
Dear experts,

I've developed a web application wherein an admin assigns certain tasks to users registered in the application.

What I want to do is this:
Each user will run a desktop application (it is only minimized in the taskbar) that listens to the web application for task that is assigned to him.

Example:

Admin assigns task to user A through web app. User A immediately gets notified (a balloon pops-up from the taskbar icon) of the task that is assigned to him.


I assume I will need to send message directly to the IP address with port to the user? Do I have to open some sort of TCP client on the windows forms application? Though, I'm not sure.

Also, how do I send the messages from the web app to the windows forms app?

Please point me in the right direction.
0
Comment
Question by:the_7th_king
7 Comments
 
LVL 16

Expert Comment

by:Easwaran Paramasivam
ID: 36482697
As far I know direct communication from web to windows application could not be done. You can communicate through following way:

  1 . Write message from web application intermediate storage such as MSMQ, or a Flat file or store in database based on your requirement.
  2. Read the message from the intermediate storage to your windows applicaton.

0
 
LVL 2

Author Comment

by:the_7th_king
ID: 36482741
what about methods of tcpclient or something?
0
 
LVL 15

Expert Comment

by:x77
ID: 36482763
When you use Tcp,  client need suscribe to server an server anotate each client Ip Address to send notifications.

There are also other protocol. Udp supports Broadcast.
On a LAN, a program can send a message to a Ip Mask. All client receive the message depending on Ip mask.
Note that with UDP (On LAN only) you do´nt need anotate client Ip to send notifications.

Udp works also with WAN, but broadcast is limited to a ip list.

Udp protocol allow send messages without connect. But reception is not granted.
Message length is limited (512 to 1024 bytes depending on network configuration).
Mesage reception order is not granted on UDP.
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 500 total points
ID: 36482775
0
 
LVL 40
ID: 36482960
A Web service with a custom event. The application subscribes to the event. The administrator calls a method that triggers the event, passing the task in the EventArgs parameter.

A fast search for "Web Service Event" (http://www.bing.com/search?q=web+service+event&go=&qs=n&sk=&form=QBLH&filt=all) will show you different ways you could set up a Web service event.
0
 

Expert Comment

by:mkuzman
ID: 36483115
Having a push based notification scheme over TCP may not be the best idea.  If the client is offline, and you want to have some sort of guarantee that a notification was received, then your TcpServer will need to cache notifications (let alone the requirement to know what users are on which IPs).

I would do this the other way around - leveraging the fact that you already have a working  HTTP transport (web server).

So...  Client contacts Web Server via Web Service Call every now and then, with a NotificationRequest({from user}).  Web Service responds with NotificationResponse (for the requested user) - it may be the Notification (or a collection of notifications, if the client has been offline for a while), or nothing at all (if there are no notifications pending).

Your desktop client then only needs to create a WebRequest (instead of being a full-blown TcpClient).
http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx

Bootnote:  If you are using Windows Authentication in IIS then your Web Method doesn't need to accept a "{from user}"-type parameter.  It can infer from current HttpContext (User.Identity)
eg.
[WebMethod]
public NotificationResponse[] NotificationRequest() {

   string userName = HttpContext.User.Identity.Name;
   ...

}
0
 
LVL 2

Author Closing Comment

by:the_7th_king
ID: 36707681
thanks!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Latency in .net app using DB in .net 21 28
Data is not showing from images 15 37
.Net Web Site IIS Web.Config Content-Security-Policy 1 43
Connection String 16 43
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now