您当前的位置: 首页 > 

DS小龙哥

暂无认证

  • 5浏览

    0关注

    679博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

13.3.2 socket函数介绍

DS小龙哥 发布时间:2021-10-26 20:36:10 ,浏览量:5

13.3.2 socket函数介绍

(1) 构造函数

QBluetoothSocket(QBluetoothServiceInfo::Protocol socketType, QObject *parent = Q_NULLPTR)
QBluetoothSocket(QObject *parent = Q_NULLPTR)

(2) 中止当前连接并重置套接字

void QBluetoothSocket::abort()  //关闭连接
void QBluetoothSocket::close()  //关闭连接

与disconnectFromService()不同,此函数立即关闭套接字,放弃写入缓冲区中未发出的任何数据。

注意:在Android上,中止套接字需要与Android线程进行异步交互。 因此,关联的disconnect()和stateChanged()信号将被延迟,直到线程完成关闭。

(3)

关注
打赏
1664009229
查看更多评论
立即登录/注册

微信扫码登录

0.1990s