80

qt 实现简单聊天(一个服务器和多个客服端)-hailong

 6 years ago
source link: http://blog.51cto.com/haidragon/2073645
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
源码地址:https://github.com/haidragon/easyChat思路:一个服务器一直接听某个ip的某个端口listen(QHostAddress::Any,port);2.一个服务器有一个容器保存所有各客服端的链接(每个链接都是一个类)。QList<TcpClientSocket*>tcpClientSocketList;每当一个客服端链接上那个服务器一直接听的套节

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK