Hi all, I'm unable to use raw sockets with Mono. I've written a small sniffer for test purposes, and I always get the following error message:
Unhandled Exception: System.Net.Sockets.SocketException:
Network subsystem is down in (unmanaged)
/usr/local/lib/libmono.so.0(mono_raise_exception+0x1b) [0xc0b817]
in (unmanaged) /usr/local/lib/libmono.so.0 [0xc2683d]
in <0x00054> System.Net.Sockets.Socket:.ctor
(System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType,
System.Net.Sockets.ProtocolType)
The code fragment that causes the exception above is
Socket socket = new Socket(
AddressFamily.InterNetwork,
SocketType.Raw, // doesn't work!!!
ProtocolType.IP);
Attached to this you will find a tarball that contains the
full source code... just build and try it as superuser!
Note that the attached code works fine on M$ Windows.
Any idea? Are raw sockets already supported by Mono?
Thanks,
j3d
----------------------------------------
Giuseppe Greco
::agamura::
phone: +41 91 604 67 65
mobile: +41 76 390 60 32
email: [EMAIL PROTECTED]
web: www.agamura.com
----------------------------------------
socket.tar.gz
Description: application/compressed-tar
