Results 1 to 3 of 3

Thread: Can i make ICMP protocol to use QTcpsocket?

  1. #1

    Question Can i make ICMP protocol to use QTcpsocket?

    Hello, there.

    I'd like to reviice the data of 'ping'. so onesome said "QProcess". However

    I want to use QTcpsocket because of next version.

    return to the subject,

    Can i make ICMP protocol with QTcpsocket.

    or use Winsock2 socket. I found source made by C . It used Winsock2.


    If i made a struct of Ip header and icmp , how should i start init(), sendto().

    thank for watching.

    Have nice day.

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Can i make ICMP protocol to use QTcpsocket?

    Quote Originally Posted by remnant24c@nate.com View Post
    I'd like to reviice the data of 'ping'. so onesome said "QProcess".
    The following link have what you want. Please see the post number 6 of the thread.
    http://www.qtcentre.org/forum/f-qt-p...light=QProcess

    Quote Originally Posted by remnant24c@nate.com View Post
    Can i make ICMP protocol with QTcpsocket.
    or use Winsock2 socket. I found source made by C . It used Winsock2.
    Yes ! Whatever you can do with Winsock can be done with QTcpSocket. But ICMP is not a part of IP stack not TCP stack. So I am not sure that it can be achievable using QTCPSocket. But Qt have several more networking classes you can use them like:
    QAbstractSocketQUdpSocketQNetworkAccessManager
    Quote Originally Posted by remnant24c@nate.com View Post
    If i made a struct of Ip header and icmp , how should i start init(), sendto().
    Forget point to point match of winsock and qtcpsocket. You have to implement the ICMP protocol in QTchSocket. It wors like this:
    1. Connect to host
    2. Put some data over socket
    3. Read some data from socket
    4. Disconnect
    Last edited by yogeshgokul; 22nd September 2009 at 05:39.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Can i make ICMP protocol to use QTcpsocket?

    Quote Originally Posted by remnant24c@nate.com View Post
    Can i make ICMP protocol with QTcpsocket.
    No, of course not.

    or use Winsock2 socket. I found source made by C . It used Winsock2.
    These are not TCP sockets, these are not bound to any
    protocol yet, so you can bind them to any protocol, ICMP included. QTcpSocket is for handling TCP protocol.

    BTW. Crafting ICMP packets may require superuser privileges.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QUdpSocket error
    By mdecandia in forum Qt Programming
    Replies: 8
    Last Post: 25th October 2007, 10:47
  2. Window OS make distclean && qmake && make one line
    By patrik08 in forum General Programming
    Replies: 4
    Last Post: 22nd March 2007, 10:43
  3. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.