Files
ClassContent/历届学生/fontendseven/项目练习/上课项目/聊天/笔记.txt
2024-09-27 02:06:13 +08:00

47 lines
1.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

前端开发 桌面端
electron.js
v8
nodejs
electron api
进程通讯
主进程
渲染进程
nw.js
桌面端 exe dmg deb
后端
实现聊天 WebSocket
{
type: 'SocketUser' // 类型
action: '' // 到底是什么类型下的具体什么信息
data: ""
}
type:
1: SocketSystem 系统消息
2:SocketUser 用户消息
// 群聊消息
// 私聊消息
3:SocketHealthy 用来健康检查 前端发 ping,后端回复 pong
action:
- join 用户进入首页的时候,软件自动发送的 加群消息
- joinMessage 加群&离群的提示信息
- send 用户发送消息给服务器
- to 服务器 推送 给 其他用户的聊天消息
- userList 获取用户列表
心跳 来检查当前和后端的链接是否正常 每隔一两秒向服务器发送请求,服务器回复你特定的消息
重连 重新建立链接
ajax 单向通讯技术 前端 ---> 后端
websocket 双向通讯技术 前端 ---> 后端
后端 ---> 前端