Christian M. Castillo Estrada

August 7, 2006

Ping Command - MonoNetwork!!

Filed under: OBSS

After spending all the day (Sunday) jajaja creating a GUI using Glade and having it be pretty easy, but getting frustrated by how linked my code for the ping command and the GUI was, I needed to update tue GUI for each response of the command. I was looking for information about delegates and threads.

I found that: !! Responsive Application !!
http://www.mono-project.com/Responsive_Applications

It’s an excellent article which teaches you how to program multi-threaded GTK# well as how to keep your GTK# application responsive.

I could solve my problem using the follow methods:

notify = new ThreadNotify (new ReadyEvent (updatemygui));
notify.WakeupMain ();

private void updatemygui()
{
< << code >>
}

The reason I decided upon using these methos is because you can update the GUI from other thread. I create a Thread with which I can execute the ping command and get the results after that I call the method WakeupMain.

When you call the method (WakeupMain) the ThreadNotify wake and execute the method (updatemygui).

As you can see! The main Thread create a second thread and the ThreadNotify. When the second Thread calls the wakeupmain also calls the sleep so that while the second thread is sleeping, the GUI is updated by the first thread with the new results from the ping command.

Well I need to check the follow points:

1.- Packages Received
2.- Packages Transmited
3.- Packages Lost
4.- Programming the progress bar
5.- The time for each request of the ping command

But I’m so tired !! I hope I’ll do something during next week ;)

August 5, 2006

Working — MonoNetwork Alpha

Filed under: OBSS

Lately I’ve been working on MonoNetwork’s GUI whenever I’ve found a bit of free time. I am using Glade for designing the GUI. Also, I decided to create a class called Ping which allows to make a ping on a host, It was really hard to do but I spent some days programming it. In order to create the ping class, I used the Namespace named “System.Net”.

I decided to try create a one class for each network tool(Ping,whois,traceroute,etc…), I want to use the namespaces of .NET (Mono) because the mononetwork project will can run on Windows, Linux ann MacOSX however I could use the command ping and after that I read the standar output of the process but It produces a big problem. The command run the different ways for each operative system so that I decided to use the .NET’s classes. Mono will be who executes my classes on the different plataforms!!

I have also been trying to finish the GUI with a good Look!! jejeje. I hope soon to have a first version the MonoNetwork. It is difficult for me because I don’t have much time, My Job kill my all time!!


MonoNetwork

[ Click thumbnail for full size image ]

As yo can see I run a test of my ping class and also I show you the GUI designed using Glade!!

When I run my test (Ping.exe) the output was:

I was really happy when I saw the output!! Because I could create the command !!PING!! using C#
I wonder If I can create the others commands (tracerourte, info, who is,, ect ….. :s

Weel, See you my friend!! It’s 4:00 a.m. jajajaja I need to go to bed!!! ;)

Get free blog up and running in minutes with Blogsome
Theme designed by Ian Main