Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sending notification commands to Windows Forms application over a network

Posted on 2011-09-04
7
Medium Priority
?
595 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 2000 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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

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.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

722 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