Solved

Sending notification commands to Windows Forms application over a network

Posted on 2011-09-04
7
566 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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