[Qt-interest] QTcpSocket and IRC

Markus Goetz Markus.Goetz at nokia.com
Thu Apr 15 18:45:40 CEST 2010


ext Robin Krahl wrote:
> Hi list!
>
> I’m having a problem with Qt and IRC. I’m just trying to implement a IRC
> connection with a QTcpSocket. I get connected to the server, but the
> connection gets closed (identd error) by foreign host although I sent
> USER and NICK commands. I tried the same with telnet, and everything
> worked fine. The code can be found here [1]. Has anyone an idea how to
> fix my problem?
>
> Regards,
> Robin
>
> PS: I know the part with “msg.trimmed() == "NOTICE AUTH :*** Found your
> hostname"” is no good style, but I’ll change this later on; when
> everything works. ;)
>
> [1] http://gitorious.org/rcc/rcc/blobs/master/src/ircnetworkconnection.cpp
>   
You are not writing the \n at the end of each line.

Also, in your slotRead you should always check with 
while(m_socket->canReadLine()) before calling readLine().

Markus



More information about the Qt-interest-old mailing list