Re: Deriving a new Ping class from System.Net.NetworkInformation.Ping
- From: "Cathal Connolly [C# MVP]" <cconnolly@xxxxxxxxxxxxxxxxx>
- Date: Wed, 20 Jul 2005 05:04:06 +0100
As far as I remember the NetworkInformation.Ping class only supports ICMP.
If you want to do a tcp-ping, then you're probably better off looking at
System.Net.Sockets namespace.
http://msdn2.microsoft.com/library/1612451t(en-us,vs.80).aspx (I'm assuming
you're working with one of the CTP or Beta drops of 2.0)
Cathal
"Eric Wenger" <eric_wenger@xxxxxxxxx> wrote in message
news:1121815367.849468.283820@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I'm pretty new to C# and I'm trying to do what I believe should be a
> simple thing. I want to modify a program that is using the
> System.Net.NetworkInformation.Ping class to have some custom behavior.
> For example I would like to do a "TCP-ping" where I try to connect to a
> TCP port on a remote machine. It seems obvious to me that I should try
> to derive a new Ping class (TCPPing) from the existing class so that I
> can use its interfaces.
>
> Unfortunately for me, the PingReply class (returned by Ping.Send())
> does not have a constructor and has no settable properties. It seems
> like I would have to go into "unsafe" code land to figure out what's
> inside but I can't do that either.
>
> Is there a solution to this or do I need to try a different approach?
>
.
- Follow-Ups:
- Re: Deriving a new Ping class from System.Net.NetworkInformation.Ping
- From: Eric Wenger
- Re: Deriving a new Ping class from System.Net.NetworkInformation.Ping
- References:
- Deriving a new Ping class from System.Net.NetworkInformation.Ping
- From: Eric Wenger
- Deriving a new Ping class from System.Net.NetworkInformation.Ping
- Prev by Date: Re: exposing methods and props in c# dll via COM
- Next by Date: Re: stuck newbie: enumerator problem
- Previous by thread: Deriving a new Ping class from System.Net.NetworkInformation.Ping
- Next by thread: Re: Deriving a new Ping class from System.Net.NetworkInformation.Ping
- Index(es):