Comments (8)
看看是否触发了OnUpgrade,如果没触发则说明没完成WebSocket握手。
from hp-socket.
from hp-socket.
那就没问题了呀,随时可以用SendWSMessage发消息了,只需注意mask参数必须为空。
from hp-socket.
pServer->SendWSMessage(dwConnID, TRUE, 0, 1, nullptr, (LPBYTE)(LPCSTR)"123,ABC.", 8);
注意第二和第五个参数。
from hp-socket.
我在服务端调用SendWSMessage方法时,直接使用你提供的这些参数现在可以发送了,但是我之前看Demo里面是调用了GetWSMessageState来获取final,reserved,operationCode相关内容,然后传给SendWSMessage方法的,GetWSMessageState方法是必须的吗?还有我跟踪了下GetWSMessageState方法,如果客户端发送过消息,服务端调用该方法返回是正常的,如果客户端只是连接并且升级完协议,没有发送过消息之前,服务端调用GetWSMessageState取到的值就不对了,是需要做什么判断吗?
from hp-socket.
好好研究ws协议,看看这些参数是什么含义。
from hp-socket.
GetWSMessageState只有在websocket事件处理函数中调用才有意义。
from hp-socket.
好的,我再好好学习ws协议,谢谢啦
from hp-socket.
Related Issues (20)
- 在DLL中使用HP-Socket时退出DLL时卡死 HOT 3
- Invalid request code 然后程序崩溃 HOT 2
- ubuntu 22.04 HOT 2
- 无法启动服务器。( The listener will not start.) HOT 12
- 求官方支持macos和ios HOT 2
- 建议封装一个websocket类 HOT 2
- UDP服务端运行一会后奔溃 客户端以非常快速度发送数据 HOT 9
- mint
- 能否加入zstd压缩库 HOT 3
- 向全体发送消息时 调用Send有的时候发不出去 必须稍微延迟一会 HOT 2
- 6.0.1没发布?看日志记录有6.0.1 HOT 2
- 流式数据压缩 怎么用呀 HOT 4
- 作者是那个国家的? HOT 1
- 可以支持vcpkg? HOT 1
- 解压算法出错,解压数据不能正确处理 HOT 4
- HP_Create_BrotliCompressor 函数请求支持lambda表达式绑定 HOT 1
- 断线重连机制卡死 HOT 2
- 请问有没有类似sendmmsg和recvmmsg的支持,或者其他加速小包(payloa在32~64 Bytes)发送的功能呢 HOT 1
- 建议增加设置/获取 组件标识符功能, 为多个组件共用一个监听器提供便利 HOT 2
- 可以做个vcpkg的包吗? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hp-socket.