Qt6 topics merged with General

QTcpsocket telnet connection ...

  • I try to connect a QtcpSocket client to telnet server ..... if launch

    MyQTcpSocket->connectToHost("", 23);

    connection is establish and is valid but I'm not able to write to the server....

    Is normal these (my connection is over ethernet switch to eth0 port from client to eth port in server)...


  • Lifetime Qt Champion


    How did you confirm that the connection was established ?

  • Yes .... the server when I disconnect closing my app (tcpsocket run inside a subclass of qthread) show to display the messages:

    serverx: eof from client
    serverx: disconnect from client 1 (my test login).


  • Lifetime Qt Champion

    And what are you writing to the server ?

  • mytcpysoket->write("hello passworld loginName\n");

    If write these (whitout \n) whit terminal the server accept my connection end reply my "hello loginName" ....

    in the terminal normally i write:

    telnet ip port<--- with socket i write: mytcpsocket->hostconnection(""xxx.xxx.xx.xx, port");
    ....server response for ok connection.....
    hello passworld loginName<----my login
    hello loginName <---- server response

    I try to use wireshark an there is no |n at end string but ?? caracters ... i try to do these .... without success .... the packet send with terminal telnet commad is totally different to QTcpSocket packet send???


  • Lifetime Qt Champion

    You should take a look at the Telnet protocol e.g. here

Log in to reply