[Mono-list] Socket problem

Alex Nedelcu bonefry at gmail.com
Wed Jul 12 14:52:47 EDT 2006


I am sorry I don't have more time to help you, but if you don't find the 
problem, a good old-fashioned way to solve it is ... by invoking the ping 
command in a separate process and grabbing the output.

ping -c 3 www.google.com
(it pings the host 3 times before it stops, otherwise it goes forever and 
you'd have to manually kill the process)

The you just read the output, execute some regular expressions on it, and get 
the info you want.


On Wednesday 12 July 2006 21:30, analyzer2 at gmx.net wrote:
> Thanks, but I think it's stupid. UNIX/Linux users never working as root. Is
> there an other way to send a ping?
>
> Karsten
> -------- Original-Nachricht --------
> Datum: Wed, 12 Jul 2006 12:24:25 -0600
> Von: Peter Dennis Bartok <peter at novonyx.com>
> An: analyzer2 at gmx.net, mono-list at lists.ximian.com
> Betreff: Re: [Mono-list] Socket problem
>
> > I may be wrong, but I thought you needed root rights for ICMP. Have you
> > tried running your mono app as root?
> >
> > Peter
> >
> > -----Original Message-----
> > From: <analyzer2 at gmx.net>
> > To: <mono-list at lists.ximian.com>
> > Date: 12 July, 2006 12:14
> > Subject: [Mono-list] Socket problem
> >
> >
> > Hello together
> >
> > I use Mono to create a small C# console project. In this project I send
> > an ping to check the host. I didn't write the ICMP class self.
> >
> > ICMP class: http://cpp.sourceforge.net/?show=17688
> >
> > Code to use the class:
> > ICMP ping = new ICMP();
> > ping.Open();
> > TimeSpan span = ping.Send("66.249.85.104", new TimeSpan(0,0,5));
> >
> > Unfortunately there is a exception:
> > Unhandled Exception: System.Net.Sockets.SocketException: Access denied
> > in <0x000b8> System.Net.Sockets.Socket:.ctor (AddressFamily family,
> > SocketType type, ProtocolType proto)
> > in [0x00004] (at cPing.cs:41) ICMP:Open ()
> > in [0x00007] (at Main.cs:14) MainClass:Main (System.String[] args
> >
> > I tested the same code to a Visual Studio 2005 Pro. installation. It runs
> > fine.
> >
> > Do you have any idea?
> >
> > Thanks.
> >
> > Greetz
> > Karsten
> > --
> >
> >
> > Echte DSL-Flatrate dauerhaft für 0,- Euro*!
> > "Feel free" mit GMX DSL! http://www.gmx.net/de/go/dsl
> > _______________________________________________
> > Mono-list maillist  -  Mono-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list


More information about the Mono-list mailing list