Notification Client and Server Written in C#

Introduction

This article is about two small programs that will allow you to send and receive messages across a normal socket and display the message inside a "balloon" notification.

Background

I was using several applications to communicate messages to various users, and found that the many different methods were becoming somewhat cumbersome. So I hastily slapped together some C# code and came up with the following programs. I had never done any real C# programming before, and it was definitely a learning experience.

Using the Code

The NotifyServer program is pretty simple. Pick a port number and hit the Start button to begin listening. Hit the Stop button to end the listener.

Points of Interest

This was one of the first C# projects I ever did, so I'm sure it's quite messy. I'm still learning about thread safety, delegates, and all the other interesting little "gotchas" that come along with the .NET Framework. I'm sure that there are a lot of things done wrong in this program.

Apparently, there is a min and max value for balloon timeouts. The timeout is somewhere between 10 and 30 seconds. You can specify a timeout in between those values and it will be obeyed. However, anything over or under those timeouts is ignored and a default timeout is used instead. The timeout counter doesn't seem to tick when the user is idle.

You can use any type of client that can send information over a socket.

the attached zip contains the .cs code, and the complied .exe. - The executables work great and show what you are doing, but to recreate the project to work/change etc you need to have the forms created in the correct way.
Can you include your .Designer.cs files (or just the whole project with icons etc)?
Cheers!

It should be pretty easy. You can see from my example how to set up a listener(or you can do a search for tcplistener and pull up the msdn documentation[it has examples]).

So in your C# application, set up a listener. Pick a port you want to listen to, and if you only want to receive alerts from that one server, put in that servers IP address. If you want to receive multiple IP addresses, you will want to use System.Net.IPAddress.Any. Only use this if you are on a private network as it opens that port up to possible unwanted traffic.

From your LAMP, I'm not sure if you are using perl, php or python. Either way, I'm sure all of them have the ability to write to sockets. For instance, in perl: