2016年3月2日星期三

AsyncSocket的长连接使用 - ^平衡

本邮件内容由第三方提供,如果您不想继续收到该邮件,可 点此退订
AsyncSocket的长连接使用 - ^平衡  阅读原文»

【摘要】使用背景:需要跟服务器长期保持连接进行即时通讯;还有在跟智能硬件建立实时链接进行同步智能硬件的状态等,最近我就做项目就碰到需要实时更新智能硬件的状态(比如智能硬件的电量,以及其它工作状态),跟智能硬件通讯中间是通过了服务器的,所以要实时跟服务器建立连接。具体实现如下: 使用步骤: 1、导入Async 阅读全文

H5前端面试题及答案(2) - 羯瑞。  阅读原文»

【摘要】最近想着跳槽,但面试的邀约不多,内心有点烦躁。梳理梳理心情,跳槽季竞争也大,努力做好自己... 21.请设计一套方案,用于确保页面中js加载完全。 alert标 <a href="http://www.cnblogs.com/chenrf/p/5216710.html" target="_blank">阅读全文</a></p></div><p><a target='blank' href='http://www.cnblogs.com/'>阅读更多内容</a></p> <img src="http://list.qq.com/cgi-bin/qf_statread?uin=935380162&mailid=ZC1903-MPKriU3zgkKVADdhH_yDA63&rcpt=dongwenbo20.itjc@blogger.com" style="display:none;height:1px;width:1px"/> </div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> </span> <span class='post-timestamp'> 时间: <meta content='http://itlessonwiki.blogspot.com/2016/03/asyncsocket.html' itemprop='url'/> <a class='timestamp-link' href='http://itlessonwiki.blogspot.com/2016/03/asyncsocket.html?m=1' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2016-03-02T20:32:00-08:00'>20:32</abbr></a> </span> <span class='post-comment-link'> </span> </div> <div class='post-footer-line post-footer-line-2'> <div class='mobile-link-button goog-inline-block' id='mobile-share-button'> <a href='javascript:void(0);'>共享</a> </div> </div> </div> </div> <div class='comments' id='comments'> <a name='comments'></a> <h4>没有评论:</h4> <div id='Blog1_comments-block-wrapper'> <dl class='avatar-comment-indent' id='comments-block'> </dl> </div> <p class='comment-footer'> <div class='comment-form'> <a name='comment-form'></a> <h4 id='comment-post-message'> <a href='javascript:void(0)' id='Blog1_comment-editor-toggle-link'>发表评论</a></h4> <p> </p> <a href='https://www.blogger.com/comment/frame/3348460672946280676?po=7892838314521681974&hl=zh-CN&saa=85391&origin=http://itlessonwiki.blogspot.com&m=1' id='comment-editor-src'></a> <iframe allowtransparency='true' class='blogger-iframe-colorize blogger-comment-from-post' frameborder='0' height='410px' id='comment-editor' name='comment-editor' src='' style='display: none' width='100%'></iframe> <script src='https://www.blogger.com/static/v1/jsbin/1345082660-comment_from_post_iframe.js' type='text/javascript'></script> <script type='text/javascript'> BLOG_CMT_createIframe('https://www.blogger.com/rpc_relay.html'); </script> </div> </p> </div> </div> </div> </div> </div> <div class='blog-pager' id='blog-pager'> <div class='mobile-link-button' id='blog-pager-newer-link'> <a class='blog-pager-newer-link' href='http://itlessonwiki.blogspot.com/2016/03/fw-enwaca-obliss.html?m=1' id='Blog1_blog-pager-newer-link' title='较新的博文'>‹</a> </div> <div class='mobile-link-button' id='blog-pager-older-link'> <a class='blog-pager-older-link' href='http://itlessonwiki.blogspot.com/2016/03/springmvc-handleradapter.html?m=1' id='Blog1_blog-pager-older-link' title='较早的博文'>›</a> </div> <div class='mobile-link-button' id='blog-pager-home-link'> <a class='home-link' href='http://itlessonwiki.blogspot.com/?m=1'>主页</a> </div> <div class='mobile-desktop-link'> <a class='home-link' href='http://itlessonwiki.blogspot.com/2016/03/asyncsocket.html?m=0'>查看网络版本</a> </div> </div> <div class='clear'></div> </div></div> </div> </div> <div class='column-left-outer'> <div class='column-left-inner'> <aside> </aside> </div> </div> <div class='column-right-outer'> <div class='column-right-inner'> <aside> </aside> </div> </div> </div> <div style='clear: both'></div> <!-- columns --> </div> <!-- main --> </div> </div> <div class='main-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> <footer> <div class='footer-outer'> <div class='footer-cap-top cap-top'> <div class='cap-left'></div> <div class='cap-right'></div> </div> <div class='fauxborder-left footer-fauxborder-left'> <div class='fauxborder-right footer-fauxborder-right'></div> <div class='region-inner footer-inner'> <div class='foot no-items section' id='footer-1'></div> <!-- outside of the include in order to lock Attribution widget --> <div class='foot section' id='footer-3' name='页脚'> <div class='widget Attribution' data-version='1' id='Attribution1'> <div class='widget-content' style='text-align: center;'> 由 <a href='https://www.blogger.com' target='_blank'>Blogger</a> 提供支持. </div> <div class='clear'></div> </div></div> </div> </div> <div class='footer-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> </footer> <!-- content --> </div> </div> <div class='content-cap-bottom cap-bottom'> <div class='cap-left'></div> <div class='cap-right'></div> </div> </div> </div> <script type='text/javascript'> window.setTimeout(function() { document.body.className = document.body.className.replace('loading', ''); }, 10); </script> <script type="text/javascript" src="https://www.blogger.com/static/v1/widgets/382300504-widgets.js"></script> <script type='text/javascript'> var BLOG_BASE_IMAGE_URL = 'https://resources.blogblog.com/img';var BLOG_LANG_DIR = 'ltr';window['__wavt'] = 'AOuZoY4V2OvM1QFI_Kt61mL94wRiQnQ5Tg:1766199663779';_WidgetManager._Init('//www.blogger.com/rearrange?blogID\x3d3348460672946280676','//itlessonwiki.blogspot.com/2016/03/asyncsocket.html?m\x3d1','3348460672946280676'); _WidgetManager._SetDataContext([{'name': 'blog', 'data': {'blogId': '3348460672946280676', 'title': 'IT\u6559\u7a0b', 'url': 'http://itlessonwiki.blogspot.com/2016/03/asyncsocket.html?m\x3d1', 'canonicalUrl': 'http://itlessonwiki.blogspot.com/2016/03/asyncsocket.html', 'homepageUrl': 'http://itlessonwiki.blogspot.com/?m\x3d1', 'searchUrl': 'http://itlessonwiki.blogspot.com/search', 'canonicalHomepageUrl': 'http://itlessonwiki.blogspot.com/', 'blogspotFaviconUrl': 'http://itlessonwiki.blogspot.com/favicon.ico', 'bloggerUrl': 'https://www.blogger.com', 'hasCustomDomain': false, 'httpsEnabled': true, 'enabledCommentProfileImages': true, 'gPlusViewType': 'FILTERED_POSTMOD', 'adultContent': false, 'analyticsAccountNumber': '', 'encoding': 'UTF-8', 'locale': 'zh-CN', 'localeUnderscoreDelimited': 'zh_cn', 'languageDirection': 'ltr', 'isPrivate': false, 'isMobile': true, 'isMobileRequest': true, 'mobileClass': ' mobile', 'isPrivateBlog': false, 'isDynamicViewsAvailable': true, 'feedLinks': '\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22IT\u6559\u7a0b - Atom\x22 href\x3d\x22http://itlessonwiki.blogspot.com/feeds/posts/default\x22 /\x3e\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/rss+xml\x22 title\x3d\x22IT\u6559\u7a0b - RSS\x22 href\x3d\x22http://itlessonwiki.blogspot.com/feeds/posts/default?alt\x3drss\x22 /\x3e\n\x3clink rel\x3d\x22service.post\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22IT\u6559\u7a0b - Atom\x22 href\x3d\x22https://www.blogger.com/feeds/3348460672946280676/posts/default\x22 /\x3e\n\n\x3clink rel\x3d\x22alternate\x22 type\x3d\x22application/atom+xml\x22 title\x3d\x22IT\u6559\u7a0b - Atom\x22 href\x3d\x22http://itlessonwiki.blogspot.com/feeds/7892838314521681974/comments/default\x22 /\x3e\n', 'meTag': '', 'adsenseClientId': 'ca-pub-5811115492232765', 'adsenseHostId': 'ca-host-pub-1556223355139109', 'adsenseHasAds': true, 'adsenseAutoAds': false, 'boqCommentIframeForm': true, 'loginRedirectParam': '', 'view': '', 'dynamicViewsCommentsSrc': '//www.blogblog.com/dynamicviews/4224c15c4e7c9321/js/comments.js', 'dynamicViewsScriptSrc': '//www.blogblog.com/dynamicviews/daef15016aa26cab', 'plusOneApiSrc': 'https://apis.google.com/js/platform.js', 'disableGComments': true, 'interstitialAccepted': false, 'sharing': {'platforms': [{'name': '\u83b7\u53d6\u94fe\u63a5', 'key': 'link', 'shareMessage': '\u83b7\u53d6\u94fe\u63a5', 'target': ''}, {'name': 'Facebook', 'key': 'facebook', 'shareMessage': '\u5206\u4eab\u5230 Facebook', 'target': 'facebook'}, {'name': 'BlogThis!', 'key': 'blogThis', 'shareMessage': 'BlogThis!', 'target': 'blog'}, {'name': 'X', 'key': 'twitter', 'shareMessage': '\u5206\u4eab\u5230 X', 'target': 'twitter'}, {'name': 'Pinterest', 'key': 'pinterest', 'shareMessage': '\u5206\u4eab\u5230 Pinterest', 'target': 'pinterest'}, {'name': '\u7535\u5b50\u90ae\u4ef6', 'key': 'email', 'shareMessage': '\u7535\u5b50\u90ae\u4ef6', 'target': 'email'}], 'disableGooglePlus': true, 'googlePlusShareButtonWidth': 0, 'googlePlusBootstrap': '\x3cscript type\x3d\x22text/javascript\x22\x3ewindow.___gcfg \x3d {\x27lang\x27: \x27zh_CN\x27};\x3c/script\x3e'}, 'hasCustomJumpLinkMessage': false, 'jumpLinkMessage': '\u9605\u8bfb\u5168\u6587', 'pageType': 'item', 'postId': '7892838314521681974', 'postImageUrl': 'http://list.qq.com/cgi-bin/qf_statread?uin\x3d935380162\x26mailid\x3dZC1903-MPKriU3zgkKVADdhH_yDA63\x26rcpt\x3ddongwenbo20.itjc@blogger.com', 'pageName': 'AsyncSocket\u7684\u957f\u8fde\u63a5\u4f7f\u7528 - ^\u5e73\u8861', 'pageTitle': 'IT\u6559\u7a0b: AsyncSocket\u7684\u957f\u8fde\u63a5\u4f7f\u7528 - ^\u5e73\u8861'}}, {'name': 'features', 'data': {}}, {'name': 'messages', 'data': {'edit': '\u4fee\u6539', 'linkCopiedToClipboard': '\u94fe\u63a5\u5df2\u590d\u5236\u5230\u526a\u8d34\u677f\uff01', 'ok': '\u786e\u5b9a', 'postLink': '\u535a\u6587\u94fe\u63a5'}}, {'name': 'template', 'data': {'name': 'Simple', 'localizedName': '\u7b80\u5355', 'isResponsive': false, 'isAlternateRendering': true, 'isCustom': false, 'variant': 'literate', 'variantId': 'literate'}}, {'name': 'view', 'data': {'classic': {'name': 'classic', 'url': '?view\x3dclassic'}, 'flipcard': {'name': 'flipcard', 'url': '?view\x3dflipcard'}, 'magazine': {'name': 'magazine', 'url': '?view\x3dmagazine'}, 'mosaic': {'name': 'mosaic', 'url': '?view\x3dmosaic'}, 'sidebar': {'name': 'sidebar', 'url': '?view\x3dsidebar'}, 'snapshot': {'name': 'snapshot', 'url': '?view\x3dsnapshot'}, 'timeslide': {'name': 'timeslide', 'url': '?view\x3dtimeslide'}, 'isMobile': true, 'title': 'AsyncSocket\u7684\u957f\u8fde\u63a5\u4f7f\u7528 - ^\u5e73\u8861', 'description': ' \u672c\u90ae\u4ef6\u5185\u5bb9\u7531\u7b2c\u4e09\u65b9\u63d0\u4f9b\uff0c\u5982\u679c\u60a8\u4e0d\u60f3\u7ee7\u7eed\u6536\u5230\u8be5\u90ae\u4ef6\uff0c\u53ef \u70b9\u6b64\u9000\u8ba2 \u3002 AsyncSocket\u7684\u957f\u8fde\u63a5\u4f7f\u7528 - ^\u5e73\u8861 \xa0\xa0 \u9605\u8bfb\u539f\u6587\xbb \u3010\u6458\u8981\u3011\u4f7f\u7528\u80cc\u666f\uff1a\u9700\u8981\u8ddf\u670d\u52a1\u5668\u957f\u671f\u4fdd\u6301\u8fde\u63a5\u8fdb\u884c\u5373\u65f6\u901a\u8baf\uff1b\u8fd8\u6709\u5728\u8ddf\u667a\u80fd\u786c\u4ef6\u5efa\u7acb\u5b9e\u65f6\u94fe\u63a5\u8fdb\u884c\u540c\u6b65\u667a\u80fd\u786c\u4ef6\u7684\u72b6\u6001\u7b49\uff0c\u6700\u8fd1\u6211\u5c31\u505a\u9879\u76ee\u5c31\u78b0\u5230...', 'featuredImage': 'https://lh3.googleusercontent.com/blogger_img_proxy/AEn0k_sI43wCourfmnbe2V4vn55sFs1fQT88kKoWmTkMokbajuzxMHdvh7UFHoHvEsZJrQ9hPkmXuvSkZo_JbTDVsWJAjuvuF4DyJenJTCzWZY5onVNAnwrIKPFKButMf_UjKxSVKsxby3dWWXWdCppd94pWbObHYk4G84PbJrKT9Pkdd34g_VNcVHh6vzTaIsJMdvs0OGeSEocnJdYNWnXLsU4', 'url': 'http://itlessonwiki.blogspot.com/2016/03/asyncsocket.html?m\x3d1', 'type': 'item', 'isSingleItem': true, 'isMultipleItems': false, 'isError': false, 'isPage': false, 'isPost': true, 'isHomepage': false, 'isArchive': false, 'isLabelSearch': false, 'postId': 7892838314521681974}}]); _WidgetManager._RegisterWidget('_HeaderView', new _WidgetInfo('Header1', 'header', document.getElementById('Header1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_BlogView', new _WidgetInfo('Blog1', 'main', document.getElementById('Blog1'), {'cmtInteractionsEnabled': false, 'mobile': true}, 'displayModeFull')); _WidgetManager._RegisterWidget('_AttributionView', new _WidgetInfo('Attribution1', 'footer-3', document.getElementById('Attribution1'), {}, 'displayModeFull')); _WidgetManager._RegisterWidget('_NavbarView', new _WidgetInfo('Navbar1', 'navbar', document.getElementById('Navbar1'), {}, 'displayModeFull')); </script> </body> </html>