[Mono-list] Creating an ICMP socket fails

TP-Software tpsoftware@users.sourceforge.net
Thu, 11 Sep 2003 10:48:01 +0200


Oops, apperantly on Linux aswell (didn't see it first, sorry)

----- Original Message ----- 
From: "Jörg Rosenkranz" <joergr@voelcker.com>
To: <mono-list@lists.ximian.com>
Sent: Thursday, September 11, 2003 10:32 AM
Subject: [Mono-list] Creating an ICMP socket fails


Hello,

We try to create an ICMP socket to ping another host. Mono on Linux throws
an
exception when the constructor of the Socket class is called.

Sample code:

using System;
using System.Net;
using System.Net.Sockets;

namespace IcmpTest
{
public class IcmpTest
{
public static void Main()
{
Socket IcmpSocket = new Socket(AddressFamily.InterNetwork, SocketType.Raw,
ProtocolType.Icmp);
}
}
}

Mono throws following exception:

Unhandled Exception: System.Net.Sockets.SocketException: Some sort of w32
error occurred: 0
in (unmanaged)
/home/viadmin/mono-cvs/install/lib/libmono.so.0(mono_raise_exception+0x22)
[0x400aee26]
in (unmanaged) /home/viadmin/mono-cvs/install/lib/libmono.so.0 [0x400d01c6]
in [0x00035] (at
/home/viadmin/mono-cvs/mcs/class/System/System.Net.Sockets/Socket.cs:417) 00
System.Net.Sockets.Socket:.ctor
(System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType,System.Net.S
ockets.ProtocolType)
in <0x00037> 00 IcmpTest.IcmpTest:Main ()

It runs fine using MS.NET.
Should I file a bug for this or are we doing something wrong?

Jörg
_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list