症状

模仿 Qt Example 里的 Fortune Server,写一个简单的服务器端程序

重载 QTcpServer 的 void QTcpServer::incomingConnection(int socketDescriptor)

当有新连接连入时输出信息 cout<<"New connection\n";

但是新连接接入没有输出。

解决方案

一直以为是服务器连接打开有问题,还把防火墙关了,死活没输出用它 Example 里的 Client 和 Server 都没有任何问题

把自己的Server删到和 FortuneServer一模一样还是没输出

万般无奈,使用 qDebug()<<"Hello your sister!";

你妹的居然输出了,恍然小误,把cout输出改成 cout<<"New connection"<<endl;

艹!

 

坑爹的endl

相关文章:

  • 2021-10-30
  • 2021-08-28
  • 2022-01-01
  • 2021-08-19
  • 2021-07-24
  • 2021-06-21
  • 2021-06-10
  • 2021-10-12
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2022-12-23
  • 2021-06-03
相关资源
相似解决方案