登录
首页 » C++ » 基于Qt的聊天室

基于Qt的聊天室

于 2022-02-11 发布 文件大小:550.82 kB
0 111
下载积分: 2 下载次数: 1

代码说明:

创建了QTcpSokcet类的实例后,可以用conncetToHost()与服务器进行连接:  QHostAddress *serverIP = new QHostAddress();  QString ip = serverIPLineEdit->text();  serverIP->setAddress(ip);  int port = 8010;  tcpSocket->connectToHost(*serverIP, port);  如果成功,将返回connected()信号,错误则返回error(QAbstrackSocket::SocketError socketError)信号 连接成功后可发送或接收数据:  发送:qunit64 write(const QByteArray &byteArray),发挥实际发送字节数,出错返回-1  接收:readyRead()信号被发送,在槽函数中编写处理数据代码,为避免错误解析数据,可用bytesAvailable()返回缓存中接收到的字节数。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 13.8
    文件的读取 添加信息,删除信息,文件的储存(Read the file to add information, delete information, document storage)
    2011-01-23 15:38:41下载
    积分:1
  • moban
    程序模板,可以自由在上面写软件,继承了一些板卡控制的DLL文件,直接调用(Program template, you can freely in the above writing software, inherited some board control DLL file called directly)
    2012-06-20 15:42:30下载
    积分:1
  • webservices动态访问
    实现webService动态调用的类库,文档包含测试程序和使用的dll,开发者可以自行扩展
    2022-07-20 14:43:44下载
    积分:1
  • The
    《C#-The-Complete-Reference》一书的源码。-"C#- The- Complete-Reference," a book source.
    2023-08-28 11:45:04下载
    积分:1
  • Dict
    中文词库 可供中文搜索引擎开发使用 可供中文分词使用(Chinese dictionary for Chinese language search engine, developed using the Chinese word used for)
    2010-06-18 03:14:42下载
    积分:1
  • cpp
    用halcon编写的代码实例,用来给初学者学习(Use halcon code examples, for beginners learning )
    2014-10-21 09:56:24下载
    积分:1
  • VeloParis100416_1_Distribution_1.1
    基于ios3.2开发的显示武汉市免费自行车站点的小程序 很不错的学习iphone开发的代码(Developed based on ios3.2 free bike show in Wuhan is a good site to learn applet code iphone development)
    2010-07-16 23:53:50下载
    积分:1
  • AES-with-ECC
    本文使用ECC加密AES的密钥,再由AES加密明文内容,AES加密强度大,速度快,但是密钥更新繁琐和不安全,由强度很大的非对称密钥算法对AES密钥加密,结合了两方的优点(this programme combine the ECC with AES.using the ECC to cipher the AES key,and using the AES to cipher the m)
    2020-06-29 10:20:02下载
    积分:1
  • CHESS
    The horse moves on a chessboard so that the whole house of sacrifice and not refuse any house twice. be fun.
    2014-02-17 05:06:24下载
    积分:1
  • Tryit Editor v3.6_files
    说明:  C++ conversion to python
    2019-03-30 12:47:44下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载