




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 自行车轮胎性能测试与选型考核试卷
- 节庆用品制作工艺考核试卷
- 能源回收系统施工考核试卷
- 玩具设计中的安全性测试与评估考核试卷
- 药品代购物流安全补充条款
- 智能仓储货架安装与仓储设备维护服务合同
- 知识产权转让与知识产权运营管理合同
- 版权运营内容审核补充协议
- 电商仓储物流安全监管及应急预案合同
- 跨国集团中国区供应链总监任职聘用协议书
- 2024年民政局离婚协议书样板
- XX医院抗菌药物临床应用监督管理机制+预警机制
- 临湘事业单位统一招聘考试真题
- 2024年全国执业兽医考试真题及答案解析
- 2024年湖南省长沙市中考地理试卷真题(含答案解析)
- 《中国健康成年人身体活动能量消耗参考值》(编制说明)
- 潮健身let's dance智慧树知到期末考试答案章节答案2024年广西师范大学
- 2《归去来兮辞并序》公开课一等奖创新教学设计统编版高中语文选择性必修下册
- 法理斗争1全文
- 医疗美容诊所规章制度上墙
- 2024年山东省青岛市城阳区中考生物模拟试卷
评论
0/150
提交评论