You are right, I forgot to call ‘init_socket()’ which initialize the socket
after creating this method…
Thanks again and have a nice day…
If you read the message titled “Using socket on QNX v.6”, you can see the
code I wrote…
“Xiaodan Tang” <firstname.lastname@example.org> wrote in message
JangHun <> email@example.com> > wrote:
I’ve posted a question(“ICMP Socket on QNX v6”) before but there was no
answer so far.
Usually we create a socket by using ‘socket( …,IPPROTO_GRE )’
and write a message by using ‘write( … )’. By the same way, there was
error or warning message when a ICMP-Socket was created by using
‘socket( …, IPPROTO_ICMP )’, but can’t write any message by using this
I don’t know what the problem is…
If there was some option I missed when I created a ICMP-Socket, please
I’ll be very happy to hear your answer.
You may want to post your “not working” piece of code, so people could
point out “why”. socket(AF_INET, SOCK_RAW, IPPROTO_ICMP) is OK, and
should work (that’s how ping works).
Now, here is a very wild guess. You forgot to do a “bind()” before you
“write()”. thus, the stack won’t know “where to send” the packet.
An alternative is using “sendto()” instead of “write()”.