版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、Golang to build a real-time interactive SaaS Cloud2019.4.23 董海冰AgendaWhats TutorMeet+ Why use Golang WebRTC Example Problems encountered About SaaSQ&AWhatsTutorMeet+?Virtual ClassroomDesktopPCTeacherPADTM+phoneTeaching MaterialsParentsTutorMeet+Feature Langugage:Golang、C+、ReactJs;:VP8、VP9、H264、A
2、V1; Audio:OPUS、AAC; Deployment:Docker、Kubernetes、Hybird cloud; Support:1v1、1vN、NvN()Why use Golang? History :orC(C+) ?Golang advantage Efficiency(多) Performance(快) Engineering(好) Less is more(省)WebRTC OverviewWebRTC Protocol StackWebRTCWebSocketWebSocket ExampleWebSocket ExampleWebRTC FlowWebRTC Exa
3、mple:Front endWebRTC Example:Front end/ Receive message from the other peer via the signalling server socket.on('message', function (message)console.log('Received message:', message);if (isJsonString(message)message = JSON.parse(message)elsemessage = message.replace(/"|"$/g
4、,'');if (message = 'got user media') checkAndStart(); else if (message.type = 'offer') if (!isInitiator && !isStarted) checkAndStart();pc.setRemoteDescription(new RTCSessionDescription(message); doAnswer(); else if (message.type = 'answer' && isStarted
5、) pc.setRemoteDescription(new RTCSessionDescription(message); else if (message.type = 'candidate' && isStarted) var candidate = new RTCIceCandidate(sdpMLineIndex:message.label, candidate:message.candidate);pc.addIceCandidate(candidate); else if (message = 'bye' && isS
6、tarted) handleRemoteHangup(););WebRTC Example:Back endDebug Toolschrome:/webrtc-internals/Demo ResultSDPWebRTC ServerOpen Source Media Server : lynckia/licode : meetecho (janus) : jitsi (meetme) :.com/lynckia/licode/【C+】.com/meetecho/janus-gateway【C】.com/jitsi/jitsi 【Java】 Kurento :.com/Kurento/kure
7、nto-media-server【C+】TM+ Architecture IAndroid & IOSChromePC NatvieWatcher3rd CallTRout ngTRoutingBeaconBeaconTGa eway1TGateway2TGateway3TMS Gate1TMS Gate2TMS Gate3TMS SFU ProxyTMS SFU ProxyTCont olRoom &dRo m &dRoom &dTMSRecord ngConsoleWh tMateriaAct niaAct niaTM+ Architecture IIGo
8、LibgRPC 、TCPWebsocket 、 Socket.IOGinRedigo(Redis)Mgo(MongoDB)ConsulProblem Iloop issuefor select case msg := <- stream: handle(msg) / message处理Problem ISolution A:for select case msg := <-stream: messages := Messagemsg for i := 0; i < len(stream); i+ messages = append(messages, <- stream
9、)handles(messages) / 批处理loop issueProblem Iloop issueSolution B:sema := make(chan *Message, 16) / for select case msg := <-stream: sema <- msggo func(sem <-chan *Message) handle(<-sem)(sema)Problem IIGo Time :p := fmt.Printlnthisday,_ := time.Parse(time.RFC3339,"2018-11-30T14:00:00+
10、08:00") tomorrow,_ := time.Parse(time.RFC3339,"2018-12-01T14:00:00+08:00") time2 := thisday.Format("2018-01-01 00:00:00")p(time2)time3 := tomorrow.Format("2018-01-01 00:00:00") p(time3)Result:time2 =30118-11-11 00:00:001128-12-12 00:00:00time3 =1128-12-12 00:00:00Problem IIGo Time :Why “2006-01-02 15:04:05”2006年1月2日3点4分5秒Format:2006-0
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025-2030全球自动包饺子机行业调研及趋势分析报告
- 2025-2030全球丙烷气体燃烧器行业调研及趋势分析报告
- 2025-2030全球便携式应急电源发电机行业调研及趋势分析报告
- 2025年全球及中国废物回收分类机行业头部企业市场占有率及排名调研报告
- 2025-2030全球X射线防护面罩行业调研及趋势分析报告
- 2025-2030全球同轴微导管系统行业调研及趋势分析报告
- 2025年全球及中国高电压钴酸锂正极材料行业头部企业市场占有率及排名调研报告
- 2025-2030全球水性涂布纸吸管行业调研及趋势分析报告
- 2025-2030全球农业机器自动方向导航设备行业调研及趋势分析报告
- 2025-2030全球光学对准服务行业调研及趋势分析报告
- 2019年420联考《申论》真题(山西卷)试卷(乡镇卷)及答案
- 医院投诉纠纷及处理记录表
- YY/T 0698.5-2023最终灭菌医疗器械包装材料第5部分:透气材料与塑料膜组成的可密封组合袋和卷材要求和试验方法
- 【深度教学研究国内外文献综述2100字】
- 牵引管道孔壁与管道外壁之间注浆技术方案
- 新人教版四年级下册数学教材解读课件
- 竣工资料封面
- 脓毒血症指南
- 中国航天知识
- 安徽华纳化学工业有限公司年产1000吨均苯四甲酸二酐、300吨润滑油助剂项目环境影响报告书
- YY 9706.230-2023医用电气设备第2-30部分:自动无创血压计的基本安全和基本性能专用要求
评论
0/150
提交评论