[Mono-list] UDP and ICMP
P Oscar Boykin
Thu, 5 Feb 2004 00:40:06 -0800
Content-Type: text/plain; charset=us-ascii
See, that's the problem.
I really don't care about getting the ICMP message, or sending it. I
just want my NON-ROOT user to know that the host he is sending a UDP
packet to is responding with "destination unreachable" packets.
There has to be (or rather should be) a way for a non-root user to know
that the packets are not being received. Otherwise, what good is the
ICMP message in the first place.
In my opinion, it would be nice if it went something like this:
If an ICMP message is sent, telling that a previous UDP packet was not
received, the ReceiveFrom method in socket should throw an exception the
next time it is called, and it should give this information. But I
guess it does not matter what I think, it only matters what the API
I am still hoping someone can tell me a way for a non-root user to get
access to this information.
On Thu, Feb 05, 2004 at 07:11:16AM +0100, Giuseppe Greco wrote:
> ... and of course, the application should be run
> as root.
> > Hello All.
> > I am using using mono to send udp packets between two hosts. At some
> > point, one host may go offline. If I watch the network (using ethereal)
> > I see the UDP packet go from A->B, and host B responds with a ICMP
> > destination unreachable packet. However, I don't see how I can get
> > access to that packet in my application.
> > I was hoping that SendTo or ReceiveFrom could throw exceptions, but I
> > don't believe that is how they work.
> > I also tried to make a separate socket to listen for the ICMP packets,
> > but under Linux and Mono 0.30, I get an exception when I try to create
> > the socket to listen for ICMP messages:
> > Unhandled Exception: System.Net.Sockets.SocketException: Access denied
> > in (unmanaged) /usr/local/lib/libmono.so.0(mono_raise_exception+0x1f)
> > [0x4009176f]
> > in (unmanaged) /usr/local/lib/libmono.so.0 [0x400b1d7d]
> > in <0x00054> System.Net.Sockets.Socket:.ctor
> > (System.Net.Sockets.AddressFamily,System.Net.Sockets.SocketType,System.=
> > in <0x000d3> Gnucla.UdpEdgeListener:.ctor (int)
> > in <0x001b0> Gnucla.EchoTest:Main (string)
> > Can anyone suggest a method that host A can see that host B is no longer
> > listening without doing it at the application layer? I just want the
> > ICMP packet to have an effect.
> > Thanks.
> > POB
> > --
> > email@example.com http://pobox.com/~boykin jabber:
> > firstname.lastname@example.org
> > fingerprint=3DD250 4AD9 4544 B7D2 A17C 911D D608 D387 6718 D75F
> > fix copyright:
> > http://cyberlaw.stanford.edu/lessig/blog/archives/EAFAQ.html
> Giuseppe Greco
> phone: +41 (0)91 604 67 65
> mobile: +41 (0)76 390 60 32
> email: email@example.com
> web: www.agamura.com
> Mono-list maillist - Monofirstname.lastname@example.org
email@example.com http://pobox.com/~boykin jabber: firstname.lastname@example.org
fingerprint=3DD250 4AD9 4544 B7D2 A17C 911D D608 D387 6718 D75F
fix copyright: http://cyberlaw.stanford.edu/lessig/blog/archives/EAFAQ.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
-----END PGP SIGNATURE-----