QSSLSocket 刷新崩溃
qint64 sent = socket->write (data, size);
socket->flush ();
这对于 QTcpSocket 可以正常工作,但最终会在 QSSLSocket 私有事件(刷新)内的 memcpy 中崩溃。我知道我应该添加更多背景信息,但已经很多了。在这里省略 socket->flush ()
可以使一切正常工作,包括。所有 SSL 握手等,所以我想知道是否有人遇到过这个?在发生这种情况之前,需要一段时间并发送大约几千字节的数据。无论如何,也许在写入后刷新是不好的做法,所以......只是好奇:-)
qint64 sent = socket->write (data, size);
socket->flush ();
This works fine with a QTcpSocket
, but eventually crashes within a memcpy inside a QSSLSocket
private event (flush). I know I should add more context, but that's a lot. Omitting socket->flush ()
here makes everything work perfectly incl. all SSL handshake etc, so I wonder if anybody has come across this? It takes a while and a few kilobytes or so of data sent before it happens. Maybe it's bad practice to flush after write anyway, so...just curious :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题,就像您在每次写入后使用刷新一样,有时“
标签不匹配
”会妨碍。已解决的问题:
每次写入后删除刷新使用。
问题就会消失。
QSSLSockets
lib 在后台自动刷新写入缓冲区,这比每次缓冲区数据写入后手动刷新更优化:)I have faced same issue and same as you was using flush after every write and sometimes "
Tag mismatch
" got in the way.Solved problem:
Remove flush usage after every write.
And problem will be gone.
QSSLSockets
lib automatically flushes write buffer behind scenes, and it is more optimal than doing manual flush after each buffer data write :)