Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7780797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:01:15+00:00 2026-06-01T19:01:15+00:00

Could someone point me in the right direction as to getting Qt to connect

  • 0

Could someone point me in the right direction as to getting Qt to connect to a Node.JS running Socket.io server?

I’ve found examples of running Qt as a server, but none reading the data back.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T19:01:17+00:00Added an answer on June 1, 2026 at 7:01 pm

    In Qt there are atleast two ways of doing it. Either using blocking or non-blocking calls. If you use non-blocking calls the you “connect” your signals to the slots of the TcpSocket class you are using. The when some data has arrived you get an event/callback is triggered. This is not a complete example:

    In your .h file declare the

    #include <QtNetwork>
    ...
    class MyClient : public QObject
    {
      std::unique_ptr<QTcpSocket> tcpSocket_;
    ...
    public slots:
      void readTcpData();
    ...
    

    then in your .cpp file do something like:

    MyClient::MyClient()
    {
      tcpSocket_ = std::unique_ptr<QTcpSocket>(new QTcpSocket(this));
      connect(tcpSocket_.get(), SIGNAL(readyRead()), this, SLOT(readTcpData()));
    }
    
    void MyClient::readTcpData()
    {
      QByteArray rawData = tcpSocket_->readAll();
      QString textData(rawData);
    ... do something with the received data.
    }
    

    To write data you can use tcpSocket_->write(…).
    So whenever data arrives the readReady() signal triggers the readTcpData() function and you know there is “some” data available to read from the socket.
    Hope it helps and answers your question. Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As I'm not strong with apache could someone point me in right direction with
Could someone point me in the right direction on how you get your Page
Could someone please point me in the right direction with respect to OHLC data
Just wondering if someone could point me in the right direction of how to
I am wondering if someone could point me in the right direction. You know
I'm just wondering if someone could point me in the right direction here, I
Could someone point me in the right direction here? Basically, I've got this jQuery
Can someone point me in the right direction? I'm not a C++ or VS
Can someone point me in the right direction with this? I need to get
I just need for someone to point me in the right direction of how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.