Your SlideShare is downloading. ×
0
简鲜侠Websocket
简鲜侠Websocket
简鲜侠Websocket
简鲜侠Websocket
简鲜侠Websocket
简鲜侠Websocket
简鲜侠Websocket
简鲜侠Websocket
简鲜侠Websocket
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

简鲜侠Websocket

869

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
869
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. The Way To HTML5  ( 2 )           ----Websocket 简鲜霞 [email_address]
  • 2.
    • a 、定义了全双工通信信道
    • b 、将 HTTP 协议升级为 websocket 协议  
    一、通讯方式
  • 3.
    • http 请求半双工的通信方式,要模拟全双工的通信方式:
    • 1 、额外的兼容性代码
    • 2 、 http 请求中带有额外的请求数据,造成网络延时;
    •         
    二、 websocket 的优势
  • 4. 二、 websocket 的优势
  • 5. 二、 websocket 的优势
    • 3 、 websocket 每一次请求之需 2B 的开销
  • 6. 三、 websocket 接口
    • 属性、监听事件、方法
  • 7. 三、 websocket 使用
    • 不支持 websocket 的情况下,使用 flash 做兼容, fdev4 组件库中实现方式 demo
    • 如: var mysocket = new FE.ui.Websocket({
    • url : ‘ws://demo.com/test’,
    • onopen : function (){
    • //todo
    • },
    • onmessage : function(event){
    • //todo event = {“type”:”message”,data:””}
    • }
    • });
  • 8. 三、 websocket 使用
    • 使用属性及方法
    • mysocket.readyState;
    • mysocket.open();
    • mysocket.close();
    • mysocket.send(data);
  • 9. That’s all

×