473,322 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Question about Sockets

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
Nov 17 '05 #1
3 1378
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
Nov 17 '05 #2

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
Nov 17 '05 #3
Bernd schrieb:


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


Hi,

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
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris | last post by:
Hi All, I've been puzzling over this, but can't find a satisfactory answer anywhere. I'm not sure if the problem is in my code, or if it's something to do with the PHP/Apache set-up (probably...
4
by: Dr.Kadzija | last post by:
i have a client-server application. client and server should communicate via tcp sockets. ok, so i use Sockets, PrintWriter and BufferedReader. the problem is that: both client and server will send...
0
by: Richard L Rosenheim | last post by:
I'm playing around with setting up a multicast socket. I can create a socket for sending, and I can one that receives. Is it possible to create one socket that can do both? The code I've been...
4
by: 0to60 | last post by:
I have a question about socket programming in general. Exactly what happens behind the scenes when I one socket connects to a different socket in listen mode? Using the dotnet framework, I...
0
by: Eternal Snow | last post by:
Hello. For some reason I need to send an IP package to myself (dest address is one of my ip addresses). (IP, not TCP/UDP) I've save the package datagram in byte array i(), included head and...
2
by: ZorpiedoMan | last post by:
I'm new to the world of sockets, and this question is not VB specific: If multiple clients access the same server on the same port, and the server is set up to do some async communication, does...
2
by: Silby | last post by:
I've been messing around with sockets for a bit and i got most of it down (i think). The server side is an asynchronous tcp socket listener with sits and waits for data. The client side uses...
1
by: Brian Henry | last post by:
Hello, I was tring to learn socket's (being i never used them before) and have a simple question. I want to create a listner that will get any data recieved and print it out. I've been able to...
2
by: djc | last post by:
I read a network programming book (based on framework 1.1) which indicated that you should 'never' use the RecieveTimeout or the SendTimeout 'socket options' on TCP sockets or you may loose data. I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.