Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTcpServer Error Setting proxy
Qt 6.11 is out! See what's new in the release blog

QTcpServer Error Setting proxy

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 5.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CuteKQ
    wrote on last edited by
    #1

    Hi all, Im trying to set proxy for a QTcpSopcket, but suddenly when I call connectToHost()
    I face with this error :" QAbstractSocket::UnsupportedSocketOperationError , The requested socket operation is not supported by the local operating system (e.g., lack of IPv6 support). "

    where is the problem?

    here the code :

    @ m_tcpSocket = new QTcpSocket();

    connect(m_tcpSocket,SIGNAL(connected()),this,SLOT(sltConnected()));
    connect(m_tcpSocket,SIGNAL(stateChanged(QAbstractSocket::SocketState)),
            this,SLOT(sltStateChanged(QAbstractSocket::SocketState)));
    connect(m_tcpSocket,SIGNAL(error(QAbstractSocket::SocketError)),
            this,SLOT(sltError(QAbstractSocket::SocketError)));
    
    p.setHostName("118.97.63.227");
    p.setPort(8080);
    p.setType(QNetworkProxy::HttpProxy);
    
    m_tcpSocket->setProxy(p);
    m_tcpSocket->connectToHost("www.google.com",80);@
    
    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved