Solved

Sending notification commands to Windows Forms application over a network

Posted on 2011-09-04
7
589 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Veeam gives away 10 full conference passes

Veeam is a VMworld 2017 US & Europe Platinum Sponsor. Enter the raffle to get the full conference pass. Pass includes the admission to all general and breakout sessions, VMware Hands-On Labs, Solutions Exchange, exclusive giveaways and the great VMworld Customer Appreciation Part

 
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

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

630 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