textwebsockethandler怎么用
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了textwebsockethandler怎么用相关的知识,希望对你有一定的参考价值。
参考技术A WebSocket protocol html5种新协议(protocol)实现浏览器与服务器全双工通信(full-duplex) 现中国站实现即通讯(real-time)所用技术都轮询(polling)轮询特定间间隔(time interval)(每1秒)由浏览器服务器发HTTP request由服务器返新数据给客服端浏览器种传统HTTP request d模式带明显缺点 – 浏览器需要断向服务器发请求(request)HTTP request header非面包含数据能值占用带宽 比较新技术做轮询效Comet – 用AJAX种技术虽达全双工通信依需要发请求(reuqest) WebSocket API浏览器服务器需要要做握手作浏览器服务器间形条快速通道两者间直接数据互相传送WebSocket 协议我实现即使服务带两处: 1. Header 互相沟通Header-概 2 Bytes 2. Server Push 服务器主传送数据给客户端 面实现简单PUSH例: 服务端代码: public class InitServlet extends HttpServlet /** * */ private static final long serialVersionUID = 1L; private static List socketList; public void init(ServletConfig config) throws ServletException InitServlet.socketList = new ArrayList(); super.init(config); System.out.println("Server start============"); public static List getSocketList() return InitServlet.socketList; public class TestWebSocketServlet extends WebSocketServlet private static final Logger log = Logger.getLogger(TestWebSocketServlet.class); /** * */ private static final long serialVersionUID = 1L; //存储链接容器 private static List connsList = new ArrayList(); @Override protected StreamInbound createWebSocketInbound(String subProtocol,HttpServletRequest request) // TODO Auto-generated method stub return new WebSocketMessageInbound(); public class WebSocketMessageInbound extends MessageInbound @Override protected void onClose(int status) // InitServlet.getSocketList().remove(this); super.onClose(status); log.debug("onClose"); InitServlet.getSocketList().remove(this); @Override protected void onOpen(WsOutbound outbound) log.debug("onOpen"); super.onOpen(outbound); InitServlet.getSocketList().add(this); @Override protected void onBinaryMessage(ByteBuffer message) throws IOException // TODO Auto-generated method stub log.debug("onBinaryMessage"); @Override protected void onTextMessage(CharBuffer message) throws IOException // TODO Auto-generated method stub log.debug("onTextMessage="+message); // this.getWsOutbound().writeTextMessage(CharBuffer.wrap("====")); // this.getWsOutbound().writeTextMessage(message); //发送给所链接 for (MessageInbound messageInbound : InitServlet.getSocketList()) CharBuffer buffer = CharBuffer.wrap(message); WsOutbound outbound = messageInbound.getWsOutbound(); outbound.writeTextMessage(buffer); outbound.flush(); web.xml配置 initServlet com.demo.websocket.InitServlet 1 websocket com.demo.websocket.TestWebSocketServlet websocket /websocket 前台代码:Send < /html
检讨销售进度用英语怎么说
在线等ING~~~用review sales progress 好像不大合适吧
参考技术A Responsible for planning and carrying out sales prospection, sales strategy and operation in related area/负责根据公司要求编制所辖区域销售预测、销售策略和计划工作;sales operation, supervising the sales procedure, and the sales performance in related area/负责管理所辖区域销售业务正常运作,监控销售进度并对销售业绩负责;
可见应为supervising the sales procedure或review the sales procedure 参考技术B review sales progress 非常合适本回答被提问者采纳 参考技术C 不错啊!
revise the sale progress 参考技术D check the sales status
以上是关于textwebsockethandler怎么用的主要内容,如果未能解决你的问题,请参考以下文章
用U盘装WIN8时提示“we couldn't create a new partition or……'