|
ms
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Question about Socketshi,
is it possible to use a Socket (proto_udp) and recieve icmp messages ? what i want to do is, send a datagram to a remote host/port and check if the host replies with port_unreachable (i think icmp type 3). is this possible with a udp Socket and the RecieveFrom() method ?. another approach would be (at least thats what i think) to use a raw socket with proto_udp. is this a wrong way to go ? thanks Bernd schrieb:
> hi, Hi,> > is it possible to use a Socket (proto_udp) and recieve icmp messages ? > what i want to do is, send a datagram to a remote host/port and check if > the host replies with port_unreachable (i think icmp type 3). > is this possible with a udp Socket and the RecieveFrom() method ?. > another approach would be (at least thats what i think) to use a raw > socket with proto_udp. > is this a wrong way to go ? > > thanks hhmmm, I think ICMP messages are not sent through UDP. So, I'm not sure but I think its not possible to do that with a UDP Socket. Yours sincerely Andy Andy Schmidt schrieb:
Show quoteHide quote > Bernd schrieb: ok, thanks for your answer. and yes you are right, icmp is not sent> >> hi, >> >> is it possible to use a Socket (proto_udp) and recieve icmp messages ? >> what i want to do is, send a datagram to a remote host/port and check if >> the host replies with port_unreachable (i think icmp type 3). >> is this possible with a udp Socket and the RecieveFrom() method ?. >> another approach would be (at least thats what i think) to use a raw >> socket with proto_udp. >> is this a wrong way to go ? >> >> thanks > > > Hi, > > hhmmm, I think ICMP messages are not sent through UDP. So, I'm not sure > but I think its not possible to do that with a UDP Socket. > > Yours sincerely > > Andy through udp. would it be possible to work with 2 sockets ? lets say i create an udp socket, send a dgram and recieve the reply with a raw socket proto_type_icmp ? thanks Bernd schrieb:
Show quoteHide quote > Hi,> > Andy Schmidt schrieb: > >>Bernd schrieb: >> >> >>>hi, >>> >>>is it possible to use a Socket (proto_udp) and recieve icmp messages ? >>>what i want to do is, send a datagram to a remote host/port and check if >>>the host replies with port_unreachable (i think icmp type 3). >>>is this possible with a udp Socket and the RecieveFrom() method ?. >>>another approach would be (at least thats what i think) to use a raw >>>socket with proto_udp. >>>is this a wrong way to go ? >>> >>>thanks >> >> >>Hi, >> >>hhmmm, I think ICMP messages are not sent through UDP. So, I'm not sure >>but I think its not possible to do that with a UDP Socket. >> >>Yours sincerely >> >>Andy > > > > ok, thanks for your answer. and yes you are right, icmp is not sent > through udp. > would it be possible to work with 2 sockets ? lets say i create an udp > socket, send a dgram and recieve the reply with a raw socket > proto_type_icmp ? > > thanks ok, I've looked in W. Richard Stevens book "TCP/IP Volume 1" and found out, that you can use the UDP Socket to receive the ICMP reply of your sent datagram. In the ICMP message the IP-Header and the first 8 bytes of the IP-Data are transmitted. And Stevens wrote: the ICMP module can assiciate with this information an UDP Port and respectivly a process with the ICMP reply. Yours sincerely Andy
Other interesting topics
C# & GC
Sinking Events and handling synchronization in a worker thread proc. Why exception when going through the DataSet? sharing form data Detective work on Application.Idle event. Problem with deriving System.EventArgs Emailing using SMTP Sinking Events and handling synchronization in a worker thread proc. (RESEND) Programmatically retrieving photos ComboBox find item based on value |
|||||||||||||||||||||||