PageRenderTime 71ms queryFilters 1ms Sphinxql 53ms app.CodeModel.GetByIds 28ms findMatchingLines 66ms GetByIds 94ms meta 0ms repositoryFilters 4ms languageFilters 4ms sourceFilters 2ms

626,242 results for 'socket repo:larchange/game' (71 ms)

Source

Language

Repository

index.js https://github.com/bigeasy/udt.git | JavaScript | 860 lines
231  // Stash the socket so we can track it by the socket identifier.
232  this.sockets[socket._socketId] = socket;
233
249  , connectionType: 1
250  , socketId: socket._socketId
251  , synCookie: 0
271  // Remove the socket from the stash.
272  delete this.sockets[socket._socketId];
273
483
484    endPoint.sockets[socket._socketId] = socket;
485
486    handshake.destination = handshake.socketId; 
487    handshake.socketId = socket._socketId; 
488
socket.io.min.js https://github.com/ngokevin/underthegun.git | JavaScript | 1,151 lines
8    <meta http-equiv="X-UA-Compatible" content="IE=edge">
9        <title>socket.io-client/dist/socket.io.min.js at master · LearnBoost/socket.io-client · GitHub</title>
10    <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
199                  <h4>
200                      <a href="/LearnBoost/socket.io-client/blob/webworker/dist/socket.io.min.js" class="js-navigation-open" data-name="webworker" rel="nofollow">webworker</a>
201                  </h4>
562      <div class="breadcrumb">
563        <span class='bold'><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/LearnBoost/socket.io-client" class="js-slide-to" data-direction="back" itemscope="url"><span itemprop="title">socket.io-client</span></a></span></span> / <span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="/LearnBoost/socket.io-client/tree/master/dist" class="js-slide-to" data-direction="back" itemscope="url"><span itemprop="title">dist</span></a></span> / <strong class="final-path">socket.io.min.js</strong> <span class="js-clippy mini-icon mini-icon-clippy " data-clipboard-text="dist/socket.io.min.js" data-copied-hint="copied!" data-copy-hint="copy to clipboard"></span>
564      </div>
632    <div class="frames">
633      <div class="frame" data-permalink-url="/LearnBoost/socket.io-client/blob/63f18383647e83ea0fcab4fbac53c25ff95db508/dist/socket.io.min.js" data-title="socket.io-client/dist/socket.io.min.js at master · LearnBoost/socket.io-client · GitHub" data-type="blob">
634
662          <td width="100%">
663                <div class="highlight"><pre><div class='line' id='LC1'>/*! Socket.IO.min.js build:0.9.11, production. Copyright(c) 2011 LearnBoost &lt;dev@learnboost.com&gt; MIT Licensed */</div><div class='line' id='LC2'>var io=&quot;undefined&quot;==typeof module?{}:module.exports;(function(){(function(a,b){var c=a;c.version=&quot;0.9.11&quot;,c.protocol=1,c.transports=[],c.j=[],c.sockets={},c.connect=function(a,d){var e=c.util.parseUri(a),f,g;b&amp;&amp;b.location&amp;&amp;(e.protocol=e.protocol||b.location.protocol.slice(0,-1),e.host=e.host||(b.document?b.document.domain:b.location.hostname),e.port=e.port||b.location.port),f=c.util.uniqueUri(e);var h={host:e.host,secure:&quot;https&quot;==e.protocol,port:e.port||(&quot;https&quot;==e.protocol?443:80),query:e.query||&quot;&quot;};c.util.merge(h,d);if(h[&quot;force new connection&quot;]||!c.sockets[f])g=new c.Socket(h);return!h[&quot;force new connection&quot;]&amp;&amp;g&amp;&amp;(c.sockets[f]=g),g=g||c.sockets[f],g.of(e.path.length&gt;1?e.path:&quot;&quot;)}})(&quot;object&quot;==typeof module?module.exports:this.io={},this),function(a,b){var c=a.util={},d=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,e=[&quot;source&quot;,&quot;protocol&quot;,&quot;authority&quot;,&quot;userInfo&quot;,&quot;user&quot;,&quot;password&quot;,&quot;host&quot;,&quot;port&quot;,&quot;relative&quot;,&quot;path&quot;,&quot;directory&quot;,&quot;file&quot;,&quot;query&quot;,&quot;anchor&quot;];c.parseUri=function(a){var b=d.exec(a||&quot;&quot;),c={},f=14;while(f--)c[e[f]]=b[f]||&quot;&quot;;return c},c.uniqueUri=function(a){var c=a.protocol,d=a.host,e=a.port;return&quot;document&quot;in b?(d=d||document.domain,e=e||(c==&quot;https&quot;&amp;&amp;document.location.protocol!==&quot;https:&quot;?443:document.location.port)):(d=d||&quot;localhost&quot;,!e&amp;&amp;c==&quot;https&quot;&amp;&amp;(e=443)),(c||&quot;http&quot;)+&quot;://&quot;+d+&quot;:&quot;+(e||80)},c.query=function(a,b){var d=c.chunkQuery(a||&quot;&quot;),e=[];c.merge(d,c.chunkQuery(b||&quot;&quot;));for(var f in d)d.hasOwnProperty(f)&amp;&amp;e.push(f+&quot;=&quot;+d[f]);return e.length?&quot;?&quot;+e.join(&quot;&amp;&quot;):&quot;&quot;},c.chunkQuery=function(a){var b={},c=a.split(&quot;&amp;&quot;),d=0,e=c.length,f;for(;d&lt;e;++d)f=c[d].split(&quot;=&quot;),f[0]&amp;&amp;(b[f[0]]=f[1]);return b};var f=!1;c.load=function(a){if(&quot;document&quot;in b&amp;&amp;document.readyState===&quot;complete&quot;||f)return a();c.on(b,&quot;load&quot;,a,!1)},c.on=function(a,b,c,d){a.attachEvent?a.attachEvent(&quot;on&quot;+b,c):a.addEventListener&amp;&amp;a.addEventListener(b,c,d)},c.request=function(a){if(a&amp;&amp;&quot;undefined&quot;!=typeof XDomainRequest&amp;&amp;!c.ua.hasCORS)return new XDomainRequest;if(&quot;undefined&quot;!=typeof XMLHttpRequest&amp;&amp;(!a||c.ua.hasCORS))return new XMLHttpRequest;if(!a)try{return new(window[[&quot;Active&quot;].concat(&quot;Object&quot;).join(&quot;X&quot;)])(&quot;Microsoft.XMLHTTP&quot;)}catch(b){}return null},&quot;undefined&quot;!=typeof window&amp;&amp;c.load(function(){f=!0}),c.defer=function(a){if(!c.ua.webkit||&quot;undefined&quot;!=typeof importScripts)return a();c.load(function(){setTimeout(a,100)})},c.merge=function(b,d,e,f){var g=f||[],h=typeof e==&quot;undefined&quot;?2:e,i;for(i in d)d.hasOwnProperty(i)&amp;&amp;c.indexOf(g,i)&lt;0&amp;&amp;(typeof b[i]!=&quot;object&quot;||!h?(b[i]=d[i],g.push(d[i])):c.merge(b[i],d[i],h-1,g));return b},c.mixin=function(a,b){c.merge(a.prototype,b.prototype)},c.inherit=function(a,b){function c(){}c.prototype=b.prototype,a.prototype=new c},c.isArray=Array.isArray||function(a){return Object.prototype.toString.call(a)===&quot;[object Array]&quot;},c.intersect=function(a,b){var d=[],e=a.length&gt;b.length?a:b,f=a.length&gt;b.length?b:a;for(var g=0,h=f.length;g&lt;h;g++)~c.indexOf(e,f[g])&amp;&amp;d.push(f[g]);return d},c.indexOf=function(a,b,c){for(var d=a.length,c=c&lt;0?c+d&lt;0?0:c+d:c||0;c&lt;d&amp;&amp;a[c]!==b;c++);return d&lt;=c?-1:c},c.toArray=function(a){var b=[];for(var c=0,d=a.length;c&lt;d;c++)b.push(a[c]);return b},c.ua={},c.ua.hasCORS=&quot;undefined&quot;!=typeof XMLHttpRequest&amp;&amp;function(){try{var a=new XMLHttpRequest}catch(b){return!1}return a.withCredentials!=undefined}(),c.ua.webkit=&quot;undefined&quot;!=typeof navigator&amp;&amp;/webkit/i.test(navigator.userAgent),c.ua.iDevice=&quot;undefined&quot;!=typeof navigator&amp;&amp;/iPad|iPhone|iPod/i.test(navigator.userAgent)}(&quot;undefined&quot;!=typeof io?io:module.exports,this),function(a,b){function c(){}a.EventEmitter=c,c.prototype.on=function(a,c){return this.$events||(this.$events={}),this.$events[a]?b.util.isArray(this.$events[a])?this.$events[a].push(c):this.$events[a]=[this.$events[a],c]:this.$events[a]=c,this},c.prototype.addListener=c.prototype.on,c.prototype.once=function(a,b){function d(){c.removeListener(a,d),b.apply(this,arguments)}var c=this;return d.listener=b,this.on(a,d),this},c.prototype.removeListener=function(a,c){if(this.$events&amp;&amp;this.$events[a]){var d=this.$events[a];if(b.util.isArray(d)){var e=-1;for(var f=0,g=d.length;f&lt;g;f++)if(d[f]===c||d[f].listener&amp;&amp;d[f].listener===c){e=f;break}if(e&lt;0)return this;d.splice(e,1),d.length||delete this.$events[a]}else(d===c||d.listener&amp;&amp;d.listener===c)&amp;&amp;delete this.$events[a]}return this},c.prototype.removeAllListeners=function(a){return a===undefined?(this.$events={},this):(this.$events&amp;&amp;this.$events[a]&amp;&amp;(this.$events[a]=null),this)},c.prototype.listeners=function(a){return this.$events||(this.$events={}),this.$events[a]||(this.$events[a]=[]),b.util.isArray(this.$events[a])||(this.$events[a]=[this.$events[a]]),this.$events[a]},c.prototype.emit=function(a){if(!this.$events)return!1;var c=this.$events[a];if(!c)return!1;var d=Array.prototype.slice.call(arguments,1);if(&quot;function&quot;==typeof c)c.apply(this,d);else{if(!b.util.isArray(c))return!1;var e=c.slice();for(var f=0,g=e.length;f&lt;g;f++)e[f].apply(this,d)}return!0}}(&quot;undefined&quot;!=typeof io?io:module.exports,&quot;undefined&quot;!=typeof io?io:module.parent.exports),function(exports,nativeJSON){function f(a){return a&lt;10?&quot;0&quot;+a:a}function date(a,b){return isFinite(a.valueOf())?a.getUTCFullYear()+&quot;-&quot;+f(a.getUTCMonth()+1)+&quot;-&quot;+f(a.getUTCDate())+&quot;T&quot;+f(a.getUTCHours())+&quot;:&quot;+f(a.getUTCMinutes())+&quot;:&quot;+f(a.getUTCSeconds())+&quot;Z&quot;:null}function quote(a){return escapable.lastIndex=0,escapable.test(a)?'&quot;'+a.replace(escapable,function(a){var b=meta[a];return typeof b==&quot;string&quot;?b:&quot;\\u&quot;+(&quot;0000&quot;+a.charCodeAt(0).toString(16)).slice(-4)})+'&quot;':'&quot;'+a+'&quot;'}function str(a,b){var c,d,e,f,g=gap,h,i=b[a];i instanceof Date&amp;&amp;(i=date(a)),typeof rep==&quot;function&quot;&amp;&amp;(i=rep.call(b,a,i));switch(typeof i){case&quot;string&quot;:return quote(i);case&quot;number&quot;:return isFinite(i)?String(i):&quot;null&quot;;case&quot;boolean&quot;:case&quot;null&quot;:return String(i);case&quot;object&quot;:if(!i)return&quot;null&quot;;gap+=indent,h=[];if(Object.prototype.toString.apply(i)===&quot;[object Array]&quot;){f=i.length;for(c=0;c&lt;f;c+=1)h[c]=str(c,i)||&quot;null&quot;;return e=h.length===0?&quot;[]&quot;:gap?&quot;[\n&quot;+gap+h.join(&quot;,\n&quot;+gap)+&quot;\n&quot;+g+&quot;]&quot;:&quot;[&quot;+h.join(&quot;,&quot;)+&quot;]&quot;,gap=g,e}if(rep&amp;&amp;typeof rep==&quot;object&quot;){f=rep.length;for(c=0;c&lt;f;c+=1)typeof rep[c]==&quot;string&quot;&amp;&amp;(d=rep[c],e=str(d,i),e&amp;&amp;h.push(quote(d)+(gap?&quot;: &quot;:&quot;:&quot;)+e))}else for(d in i)Object.prototype.hasOwnProperty.call(i,d)&amp;&amp;(e=str(d,i),e&amp;&amp;h.push(quote(d)+(gap?&quot;: &quot;:&quot;:&quot;)+e));return e=h.length===0?&quot;{}&quot;:gap?&quot;{\n&quot;+gap+h.join(&quot;,\n&quot;+gap)+&quot;\n&quot;+g+&quot;}&quot;:&quot;{&quot;+h.join(&quot;,&quot;)+&quot;}&quot;,gap=g,e}}&quot;use strict&quot;;if(nativeJSON&amp;&amp;nativeJSON.parse)return exports.JSON={parse:nativeJSON.parse,stringify:nativeJSON.stringify};var JSON=exports.JSON={},cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\&quot;\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={&quot;\b&quot;:&quot;\\b&quot;,&quot;\t&quot;:&quot;\\t&quot;,&quot;\n&quot;:&quot;\\n&quot;,&quot;\f&quot;:&quot;\\f&quot;,&quot;\r&quot;:&quot;\\r&quot;,'&quot;':'\\&quot;',&quot;\\&quot;:&quot;\\\\&quot;},rep;JSON.stringify=function(a,b,c){var d;gap=&quot;&quot;,indent=&quot;&quot;;if(typeof c==&quot;number&quot;)for(d=0;d&lt;c;d+=1)indent+=&quot; &quot;;else typeof c==&quot;string&quot;&amp;&amp;(indent=c);rep=b;if(!b||typeof b==&quot;function&quot;||typeof b==&quot;object&quot;&amp;&amp;typeof b.length==&quot;number&quot;)return str(&quot;&quot;,{&quot;&quot;:a});throw new Error(&quot;JSON.stringify&quot;)},JSON.parse=function(text,reviver){function walk(a,b){var c,d,e=a[b];if(e&amp;&amp;typeof e==&quot;object&quot;)for(c in e)Object.prototype.hasOwnProperty.call(e,c)&amp;&amp;(d=walk(e,c),d!==undefined?e[c]=d:delete e[c]);return reviver.call(a,b,e)}var j;text=String(text),cx.lastIndex=0,cx.test(text)&amp;&amp;(text=text.replace(cx,function(a){return&quot;\\u&quot;+(&quot;0000&quot;+a.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:[&quot;\\\/bfnrt]|u[0-9a-fA-F]{4})/g,&quot;@&quot;).replace(/&quot;[^&quot;\\\n\r]*&quot;|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,&quot;]&quot;).replace(/(?:^|:|,)(?:\s*\[)+/g,&quot;&quot;)))return j=eval(&quot;(&quot;+text+&quot;)&quot;),typeof reviver==&quot;function&quot;?walk({&quot;&quot;:j},&quot;&quot;):j;throw new SyntaxError(&quot;JSON.parse&quot;)}}(&quot;undefined&quot;!=typeof io?io:module.exports,typeof JSON!=&quot;undefined&quot;?JSON:undefined),function(a,b){var c=a.parser={},d=c.packets=[&quot;disconnect&quot;,&quot;connect&quot;,&quot;heartbeat&quot;,&quot;message&quot;,&quot;json&quot;,&quot;event&quot;,&quot;ack&quot;,&quot;error&quot;,&quot;noop&quot;],e=c.reasons=[&quot;transport not supported&quot;,&quot;client not handshaken&quot;,&quot;unauthorized&quot;],f=c.advice=[&quot;reconnect&quot;],g=b.JSON,h=b.util.indexOf;c.encodePacket=function(a){var b=h(d,a.type),c=a.id||&quot;&quot;,i=a.endpoint||&quot;&quot;,j=a.ack,k=null;switch(a.type){case&quot;error&quot;:var l=a.reason?h(e,a.reason):&quot;&quot;,m=a.advice?h(f,a.advice):&quot;&quot;;if(l!==&quot;&quot;||m!==&quot;&quot;)k=l+(m!==&quot;&quot;?&quot;+&quot;+m:&quot;&quot;);break;case&quot;message&quot;:a.data!==&quot;&quot;&amp;&amp;(k=a.data);break;case&quot;event&quot;:var n={name:a.name};a.args&amp;&amp;a.args.length&amp;&amp;(n.args=a.args),k=g.stringify(n);break;case&quot;json&quot;:k=g.stringify(a.data);break;case&quot;connect&quot;:a.qs&amp;&amp;(k=a.qs);break;case&quot;ack&quot;:k=a.ackId+(a.args&amp;&amp;a.args.length?&quot;+&quot;+g.stringify(a.args):&quot;&quot;)}var o=[b,c+(j==&quot;data&quot;?&quot;+&quot;:&quot;&quot;),i];return k!==null&amp;&amp;k!==undefined&amp;&amp;o.push(k),o.join(&quot;:&quot;)},c.encodePayload=function(a){var b=&quot;&quot;;if(a.length==1)return a[0];for(var c=0,d=a.length;c&lt;d;c++){var e=a[c];b+=&quot;\ufffd&quot;+e.length+&quot;\ufffd&quot;+a[c]}return b};var i=/([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/;c.decodePacket=function(a){var b=a.match(i);if(!b)return{};var c=b[2]||&quot;&quot;,a=b[5]||&quot;&quot;,h={type:d[b[1]],endpoint:b[4]||&quot;&quot;};c&amp;&amp;(h.id=c,b[3]?h.ack=&quot;data&quot;:h.ack=!0);switch(h.type){case&quot;error&quot;:var b=a.split(&quot;+&quot;);h.reason=e[b[0]]||&quot;&quot;,h.advice=f[b[1]]||&quot;&quot;;break;case&quot;message&quot;:h.data=a||&quot;&quot;;break;case&quot;event&quot;:try{var j=g.parse(a);h.name=j.name,h.args=j.args}catch(k){}h.args=h.args||[];break;case&quot;json&quot;:try{h.data=g.parse(a)}catch(k){}break;case&quot;connect&quot;:h.qs=a||&quot;&quot;;break;case&quot;ack&quot;:var b=a.match(/^([0-9]+)(\+)?(.*)/);if(b){h.ackId=b[1],h.args=[];if(b[3])try{h.args=b[3]?g.parse(b[3]):[]}catch(k){}}break;case&quot;disconnect&quot;:case&quot;heartbeat&quot;:}return h},c.decodePayload=function(a){if(a.charAt(0)==&quot;\ufffd&quot;){var b=[];for(var d=1,e=&quot;&quot;;d&lt;a.length;d++)a.charAt(d)==&quot;\ufffd&quot;?(b.push(c.decodePacket(a.substr(d+1).substr(0,e))),d+=Number(e)+1,e=&quot;&quot;):e+=a.charAt(d);return b}return[c.decodePacket(a)]}}(&quot;undefined&quot;!=typeof io?io:module.exports,&quot;undefined&quot;!=typeof io?io:module.parent.exports),function(a,b){function c(a,b){this.socket=a,this.sessid=b}a.Transport=c,b.util.mixin(c,b.EventEmitter),c.prototype.heartbeats=function(){return!0},c.prototype.onData=function(a){this.clearCloseTimeout(),(this.socket.connected||this.socket.connecting||this.socket.reconnecting)&amp;&amp;this.setCloseTimeout();if(a!==&quot;&quot;){var c=b.parser.decodePayload(a);if(c&amp;&amp;c.length)for(var d=0,e=c.length;d&lt;e;d++)this.onPacket(c[d])}return this},c.prototype.onPacket=function(a){return this.socket.setHeartbeatTimeout(),a.type==&quot;heartbeat&quot;?this.onHeartbeat():(a.type==&quot;connect&quot;&amp;&amp;a.endpoint==&quot;&quot;&amp;&amp;this.onConnect(),a.type==&quot;error&quot;&amp;&amp;a.advice==&quot;reconnect&quot;&amp;&amp;(this.isOpen=!1),this.socket.onPacket(a),this)},c.prototype.setCloseTimeout=function(){if(!this.closeTimeout){var a=this;this.closeTimeout=setTimeout(function(){a.onDisconnect()},this.socket.closeTimeout)}},c.prototype.onDisconnect=function(){return this.isOpen&amp;&amp;this.close(),this.clearTimeouts(),this.socket.onDisconnect(),this},c.prototype.onConnect=function(){return this.socket.onConnect(),this},c.prototype.clearCloseTimeout=function(){this.closeTimeout&amp;&amp;(clearTimeout(this.closeTimeout),this.closeTimeout=null)},c.prototype.clearTimeouts=function(){this.clearCloseTimeout(),this.reopenTimeout&amp;&amp;clearTimeout(this.reopenTimeout)},c.prototype.packet=function(a){this.send(b.parser.encodePacket(a))},c.prototype.onHeartbeat=function(a){this.packet({type:&quot;heartbeat&quot;})},c.prototype.onOpen=function(){this.isOpen=!0,this.clearCloseTimeout(),this.socket.onOpen()},c.prototype.onClose=function(){var a=this;this.isOpen=!1,this.socket.onClose(),this.onDisconnect()},c.prototype.prepareUrl=function(){var a=this.socket.options;return this.scheme()+&quot;://&quot;+a.host+&quot;:&quot;+a.port+&quot;/&quot;+a.resource+&quot;/&quot;+b.protocol+&quot;/&quot;+this.name+&quot;/&quot;+this.sessid},c.prototype.ready=function(a,b){b.call(this)}}(&quot;undefined&quot;!=typeof io?io:module.exports,&quot;undefined&quot;!=typeof io?io:module.parent.exports),function(a,b,c){function d(a){this.options={port:80,secure:!1,document:&quot;document&quot;in c?document:!1,resource:&quot;socket.io&quot;,transports:b.transports,&quot;connect timeout&quot;:1e4,&quot;try multiple transports&quot;:!0,reconnect:!0,&quot;reconnection delay&quot;:500,&quot;reconnection limit&quot;:Infinity,&quot;reopen delay&quot;:3e3,&quot;max reconnection attempts&quot;:10,&quot;sync disconnect on unload&quot;:!1,&quot;auto connect&quot;:!0,&quot;flash policy port&quot;:10843,manualFlush:!1},b.util.merge(this.options,a),this.connected=!1,this.open=!1,this.connecting=!1,this.reconnecting=!1,this.namespaces={},this.buffer=[],this.doBuffer=!1;if(this.options[&quot;sync disconnect on unload&quot;]&amp;&amp;(!this.isXDomain()||b.util.ua.hasCORS)){var d=this;b.util.on(c,&quot;beforeunload&quot;,function(){d.disconnectSync()},!1)}this.options[&quot;auto connect&quot;]&amp;&amp;this.connect()}function e(){}a.Socket=d,b.util.mixin(d,b.EventEmitter),d.prototype.of=function(a){return this.namespaces[a]||(this.namespaces[a]=new b.SocketNamespace(this,a),a!==&quot;&quot;&amp;&amp;this.namespaces[a].packet({type:&quot;connect&quot;})),this.namespaces[a]},d.prototype.publish=function(){this.emit.apply(this,arguments);var a;for(var b in this.namespaces)this.namespaces.hasOwnProperty(b)&amp;&amp;(a=this.of(b),a.$emit.apply(a,arguments))},d.prototype.handshake=function(a){function f(b){b instanceof Error?(c.connecting=!1,c.onError(b.message)):a.apply(null,b.split(&quot;:&quot;))}var c=this,d=this.options,g=[&quot;http&quot;+(d.secure?&quot;s&quot;:&quot;&quot;)+&quot;:/&quot;,d.host+&quot;:&quot;+d.port,d.resource,b.protocol,b.util.query(this.options.query,&quot;t=&quot;+ +(new Date))].join(&quot;/&quot;);if(this.isXDomain()&amp;&amp;!b.util.ua.hasCORS){var h=document.getElementsByTagName(&quot;script&quot;)[0],i=document.createElement(&quot;script&quot;);i.src=g+&quot;&amp;jsonp=&quot;+b.j.length,h.parentNode.insertBefore(i,h),b.j.push(function(a){f(a),i.parentNode.removeChild(i)})}else{var j=b.util.request();j.open(&quot;GET&quot;,g,!0),this.isXDomain()&amp;&amp;(j.withCredentials=!0),j.onreadystatechange=function(){j.readyState==4&amp;&amp;(j.onreadystatechange=e,j.status==200?f(j.responseText):j.status==403?c.onError(j.responseText):(c.connecting=!1,!c.reconnecting&amp;&amp;c.onError(j.responseText)))},j.send(null)}},d.prototype.getTransport=function(a){var c=a||this.transports,d;for(var e=0,f;f=c[e];e++)if(b.Transport[f]&amp;&amp;b.Transport[f].check(this)&amp;&amp;(!this.isXDomain()||b.Transport[f].xdomainCheck(this)))return new b.Transport[f](this,this.sessionid);return null},d.prototype.connect=function(a){if(this.connecting)return this;var c=this;return c.connecting=!0,this.handshake(function(d,e,f,g){function h(a){c.transport&amp;&amp;c.transport.clearTimeouts(),c.transport=c.getTransport(a);if(!c.transport)return c.publish(&quot;connect_failed&quot;);c.transport.ready(c,function(){c.connecting=!0,c.publish(&quot;connecting&quot;,c.transport.name),c.transport.open(),c.options[&quot;connect timeout&quot;]&amp;&amp;(c.connectTimeoutTimer=setTimeout(function(){if(!c.connected){c.connecting=!1;if(c.options[&quot;try multiple transports&quot;]){var a=c.transports;while(a.length&gt;0&amp;&amp;a.splice(0,1)[0]!=c.transport.name);a.length?h(a):c.publish(&quot;connect_failed&quot;)}}},c.options[&quot;connect timeout&quot;]))})}c.sessionid=d,c.closeTimeout=f*1e3,c.heartbeatTimeout=e*1e3,c.transports||(c.transports=c.origTransports=g?b.util.intersect(g.split(&quot;,&quot;),c.options.transports):c.options.transports),c.setHeartbeatTimeout(),h(c.transports),c.once(&quot;connect&quot;,function(){clearTimeout(c.connectTimeoutTimer),a&amp;&amp;typeof a==&quot;function&quot;&amp;&amp;a()})}),this},d.prototype.setHeartbeatTimeout=function(){clearTimeout(this.heartbeatTimeoutTimer);if(this.transport&amp;&amp;!this.transport.heartbeats())return;var a=this;this.heartbeatTimeoutTimer=setTimeout(function(){a.transport.onClose()},this.heartbeatTimeout)},d.prototype.packet=function(a){return this.connected&amp;&amp;!this.doBuffer?this.transport.packet(a):this.buffer.push(a),this},d.prototype.setBuffer=function(a){this.doBuffer=a,!a&amp;&amp;this.connected&amp;&amp;this.buffer.length&amp;&amp;(this.options.manualFlush||this.flushBuffer())},d.prototype.flushBuffer=function(){this.transport.payload(this.buffer),this.buffer=[]},d.prototype.disconnect=function(){if(this.connected||this.connecting)this.open&amp;&amp;this.of(&quot;&quot;).packet({type:&quot;disconnect&quot;}),this.onDisconnect(&quot;booted&quot;);return this},d.prototype.disconnectSync=function(){var a=b.util.request(),c=[&quot;http&quot;+(this.options.secure?&quot;s&quot;:&quot;&quot;)+&quot;:/&quot;,this.options.host+&quot;:&quot;+this.options.port,this.options.resource,b.protocol,&quot;&quot;,this.sessionid].join(&quot;/&quot;)+&quot;/?disconnect=1&quot;;a.open(&quot;GET&quot;,c,!1),a.send(null),this.onDisconnect(&quot;booted&quot;)},d.prototype.isXDomain=function(){var a=c.location.port||(&quot;https:&quot;==c.location.protocol?443:80);return this.options.host!==c.location.hostname||this.options.port!=a},d.prototype.onConnect=function(){this.connected||(this.connected=!0,this.connecting=!1,this.doBuffer||this.setBuffer(!1),this.emit(&quot;connect&quot;))},d.prototype.onOpen=function(){this.open=!0},d.prototype.onClose=function(){this.open=!1,clearTimeout(this.heartbeatTimeoutTimer)},d.prototype.onPacket=function(a){this.of(a.endpoint).onPacket(a)},d.prototype.onError=function(a){a&amp;&amp;a.advice&amp;&amp;a.advice===&quot;reconnect&quot;&amp;&amp;(this.connected||this.connecting)&amp;&amp;(this.disconnect(),this.options.reconnect&amp;&amp;this.reconnect()),this.publish(&quot;error&quot;,a&amp;&amp;a.reason?a.reason:a)},d.prototype.onDisconnect=function(a){var b=this.connected,c=this.connecting;this.connected=!1,this.connecting=!1,this.open=!1;if(b||c)this.transport.close(),this.transport.clearTimeouts(),b&amp;&amp;(this.publish(&quot;disconnect&quot;,a),&quot;booted&quot;!=a&amp;&amp;this.options.reconnect&amp;&amp;!this.reconnecting&amp;&amp;this.reconnect())},d.prototype.reconnect=function(){function e(){if(a.connected){for(var b in a.namespaces)a.namespaces.hasOwnProperty(b)&amp;&amp;&quot;&quot;!==b&amp;&amp;a.namespaces[b].packet({type:&quot;connect&quot;});a.publish(&quot;reconnect&quot;,a.transport.name,a.reconnectionAttempts)}clearTimeout(a.reconnectionTimer),a.removeListener(&quot;connect_failed&quot;,f),a.removeListener(&quot;connect&quot;,f),a.reconnecting=!1,delete a.reconnectionAttempts,delete a.reconnectionDelay,delete a.reconnectionTimer,delete a.redoTransports,a.options[&quot;try multiple transports&quot;]=c}function f(){if(!a.reconnecting)return;if(a.connected)return e();if(a.connecting&amp;&amp;a.reconnecting)return a.reconnectionTimer=setTimeout(f,1e3);a.reconnectionAttempts++&gt;=b?a.redoTransports?(a.publish(&quot;reconnect_failed&quot;),e()):(a.on(&quot;connect_failed&quot;,f),a.options[&quot;try multiple transports&quot;]=!0,a.transports=a.origTransports,a.transport=a.getTransport(),a.redoTransports=!0,a.connect()):(a.reconnectionDelay&lt;d&amp;&amp;(a.reconnectionDelay*=2),a.connect(),a.publish(&quot;reconnecting&quot;,a.reconnectionDelay,a.reconnectionAttempts),a.reconnectionTimer=setTimeout(f,a.reconnectionDelay))}this.reconnecting=!0,this.reconnectionAttempts=0,this.reconnectionDelay=this.options[&quot;reconnection delay&quot;];var a=this,b=this.options[&quot;max reconnection attempts&quot;],c=this.options[&quot;try multiple transports&quot;],d=this.options[&quot;reconnection limit&quot;];this.options[&quot;try multiple transports&quot;]=!1,this.reconnectionTimer=setTimeout(f,this.reconnectionDelay),this.on(&quot;connect&quot;,f)}}(&quot;undefined&quot;!=typeof io?io:module.exports,&quot;undefined&quot;!=typeof io?io:module.parent.exports,this),function(a,b){function c(a,b){this.socket=a,this.name=b||&quot;&quot;,this.flags={},this.json=new d(this,&quot;json&quot;),this.ackPackets=0,this.acks={}}function d(a,b){this.namespace=a,this.name=b}a.SocketNamespace=c,b.util.mixin(c,b.EventEmitter),c.prototype.$emit=b.EventEmitter.prototype.emit,c.prototype.of=function(){return this.socket.of.apply(this.socket,arguments)},c.prototype.packet=function(a){return a.endpoint=this.name,this.socket.packet(a),this.flags={},this},c.prototype.send=function(a,b){var c={type:this.flags.json?&quot;json&quot;:&quot;message&quot;,data:a};return&quot;function&quot;==typeof b&amp;&amp;(c.id=++this.ackPackets,c.ack=!0,this.acks[c.id]=b),this.packet(c)},c.prototype.emit=function(a){var b=Array.prototype.slice.call(arguments,1),c=b[b.length-1],d={type:&quot;event&quot;,name:a};return&quot;function&quot;==typeof c&amp;&amp;(d.id=++this.ackPackets,d.ack=&quot;data&quot;,this.acks[d.id]=c,b=b.slice(0,b.length-1)),d.args=b,this.packet(d)},c.prototype.disconnect=function(){return this.name===&quot;&quot;?this.socket.disconnect():(this.packet({type:&quot;disconnect&quot;}),this.$emit(&quot;disconnect&quot;)),this},c.prototype.onPacket=function(a){function d(){c.packet({type:&quot;ack&quot;,args:b.util.toArray(arguments),ackId:a.id})}var c=this;switch(a.type){case&quot;connect&quot;:this.$emit(&quot;connect&quot;);break;case&quot;disconnect&quot;:this.name===&quot;&quot;?this.socket.onDisconnect(a.reason||&quot;booted&quot;):this.$emit(&quot;disconnect&quot;,a.reason);break;case&quot;message&quot;:case&quot;json&quot;:var e=[&quot;message&quot;,a.data];a.ack==&quot;data&quot;?e.push(d):a.ack&amp;&amp;this.packet({type:&quot;ack&quot;,ackId:a.id}),this.$emit.apply(this,e);break;case&quot;event&quot;:var e=[a.name].concat(a.args);a.ack==&quot;data&quot;&amp;&amp;e.push(d),this.$emit.apply(this,e);break;case&quot;ack&quot;:this.acks[a.ackId]&amp;&amp;(this.acks[a.ackId].apply(this,a.args),delete this.acks[a.ackId]);break;case&quot;error&quot;:a.advice?this.socket.onError(a):a.reason==&quot;unauthorized&quot;?this.$emit(&quot;connect_failed&quot;,a.reason):this.$emit(&quot;error&quot;,a.reason)}},d.prototype.send=function(){this.namespace.flags[this.name]=!0,this.namespace.send.apply(this.namespace,arguments)},d.prototype.emit=function(){this.namespace.flags[this.name]=!0,this.namespace.emit.apply(this.namespace,arguments)}}(&quot;undefined&quot;!=typeof io?io:module.exports,&quot;undefined&quot;!=typeof io?io:module.parent.exports),function(a,b,c){function d(a){b.Transport.apply(this,arguments)}a.websocket=d,b.util.inherit(d,b.Transport),d.prototype.name=&quot;websocket&quot;,d.prototype.open=function(){var a=b.util.query(this.socket.options.query),d=this,e;return e||(e=c.MozWebSocket||c.WebSocket),this.websocket=new e(this.prepareUrl()+a),this.websocket.onopen=function(){d.onOpen(),d.socket.setBuffer(!1)},this.websocket.onmessage=function(a){d.onData(a.data)},this.websocket.onclose=function(){d.onClose(),d.socket.setBuffer(!0)},this.websocket.onerror=function(a){d.onError(a)},this},b.util.ua.iDevice?d.prototype.send=function(a){var b=this;return setTimeout(function(){b.websocket.send(a)},0),this}:d.prototype.send=function(a){return this.websocket.send(a),this},d.prototype.payload=function(a){for(var b=0,c=a.length;b&lt;c;b++)this.packet(a[b]);return this},d.prototype.close=function(){return this.websocket.close(),this},d.prototype.onError=function(a){this.socket.onError(a)},d.prototype.scheme=function(){return this.socket.options.secure?&quot;wss&quot;:&quot;ws&quot;},d.check=function(){return&quot;WebSocket&quot;in c&amp;&amp;!(&quot;__addTask&quot;in WebSocket)||&quot;MozWebSocket&quot;in c},d.xdomainCheck=function(){return!0},b.transports.push(&quot;websocket&quot;)}(&quot;undefined&quot;!=typeof io?io.Transport:module.exports,&quot;undefined&quot;!=typeof io?io:module.parent.exports,this),function(a,b){function c(){b.Transport.websocket.apply(this,arguments)}a.flashsocket=c,b.util.inherit(c,b.Transport.websocket),c.prototype.name=&quot;flashsocket&quot;,c.prototype.open=function(){var a=this,c=arguments;return WebSocket.__addTask(function(){b.Transport.websocket.prototype.open.apply(a,c)}),this},c.prototype.send=function(){var a=this,c=arguments;return WebSocket.__addTask(function(){b.Transport.websocket.prototype.send.apply(a,c)}),this},c.prototype.close=function(){return WebSocket.__tasks.length=0,b.Transport.websocket.prototype.close.call(this),this},c.prototype.ready=function(a,d){function e(){var b=a.options,e=b[&quot;flash policy port&quot;],g=[&quot;http&quot;+(b.secure?&quot;s&quot;:&quot;&quot;)+&quot;:/&quot;,b.host+&quot;:&quot;+b.port,b.resource,&quot;static/flashsocket&quot;,&quot;WebSocketMain&quot;+(a.isXDomain()?&quot;Insecure&quot;:&quot;&quot;)+&quot;.swf&quot;];c.loaded||(typeof WEB_SOCKET_SWF_LOCATION==&quot;undefined&quot;&amp;&amp;(WEB_SOCKET_SWF_LOCATION=g.join(&quot;/&quot;)),e!==843&amp;&amp;WebSocket.loadFlashPolicyFile(&quot;xmlsocket://&quot;+b.host+&quot;:&quot;+e),WebSocket.__initialize(),c.loaded=!0),d.call(f)}var f=this;if(document.body)return e();b.util.load(e)},c.check=function(){return typeof WebSocket!=&quot;undefined&quot;&amp;&amp;&quot;__initialize&quot;in WebSocket&amp;&amp;!!swfobject?swfobject.getFlashPlayerVersion().major&gt;=10:!1},c.xdomainCheck=function(){return!0},typeof window!=&quot;undefined&quot;&amp;&amp;(WEB_SOCKET_DISABLE_AUTO_INITIALIZATION=!0),b.transports.push(&quot;flashsocket&quot;)}(&quot;undefined&quot;!=typeof io?io.Transport:module.exports,&quot;undefined&quot;!=typeof io?io:module.parent.exports);if(&quot;undefined&quot;!=typeof window)var swfobject=function(){function A(){if(t)return;try{var a=i.getElementsByTagName(&quot;body&quot;)[0].appendChild(Q(&quot;span&quot;));a.parentNode.removeChild(a)}catch(b){return}t=!0;var c=l.length;for(var d=0;d&lt;c;d++)l[d]()}function B(a){t?a():l[l.length]=a}function C(b){if(typeof h.addEventListener!=a)h.addEventListener(&quot;load&quot;,b,!1);else if(typeof i.addEventListener!=a)i.addEventListener(&quot;load&quot;,b,!1);else if(typeof h.attachEvent!=a)R(h,&quot;onload&quot;,b);else if(typeof h.onload==&quot;function&quot;){var c=h.onload;h.onload=function(){c(),b()}}else h.onload=b}function D(){k?E():F()}function E(){var c=i.getElementsByTagName(&quot;body&quot;)[0],d=Q(b);d.setAttribute(&quot;type&quot;,e);var f=c.appendChild(d);if(f){var g=0;(function(){if(typeof f.GetVariable!=a){var b=f.GetVariable(&quot;$version&quot;);b&amp;&amp;(b=b.split(&quot; &quot;)[1].split(&quot;,&quot;),y.pv=[parseInt(b[0],10),parseInt(b[1],10),parseInt(b[2],10)])}else if(g&lt;10){g++,setTimeout(arguments.callee,10);return}c.removeChild(d),f=null,F()})()}else F()}function F(){var b=m.length;if(b&gt;0)for(var c=0;c&lt;b;c++){var d=m[c].id,e=m[c].callbackFn,f={success:!1,id:d};if(y.pv[0]&gt;0){var g=P(d);if(g)if(S(m[c].swfVersion)&amp;&amp;!(y.wk&amp;&amp;y.wk&lt;312))U(d,!0),e&amp;&amp;(f.success=!0,f.ref=G(d),e(f));else if(m[c].expressInstall&amp;&amp;H()){var h={};h.data=m[c].expressInstall,h.width=g.getAttribute(&quot;width&quot;)||&quot;0&quot;,h.height=g.getAttribute(&quot;height&quot;)||&quot;0&quot;,g.getAttribute(&quot;class&quot;)&amp;&amp;(h.styleclass=g.getAttribute(&quot;class&quot;)),g.getAttribute(&quot;align&quot;)&amp;&amp;(h.align=g.getAttribute(&quot;align&quot;));var i={},j=g.getElementsByTagName(&quot;param&quot;),k=j.length;for(var l=0;l&lt;k;l++)j[l].getAttribute(&quot;name&quot;).toLowerCase()!=&quot;movie&quot;&amp;&amp;(i[j[l].getAttribute(&quot;name&quot;)]=j[l].getAttribute(&quot;value&quot;));I(h,i,d,e)}else J(g),e&amp;&amp;e(f)}else{U(d,!0);if(e){var n=G(d);n&amp;&amp;typeof n.SetVariable!=a&amp;&amp;(f.success=!0,f.ref=n),e(f)}}}}function G(c){var d=null,e=P(c);if(e&amp;&amp;e.nodeName==&quot;OBJECT&quot;)if(typeof e.SetVariable!=a)d=e;else{var f=e.getElementsByTagName(b)[0];f&amp;&amp;(d=f)}return d}function H(){return!u&amp;&amp;S(&quot;6.0.65&quot;)&amp;&amp;(y.win||y.mac)&amp;&amp;!(y.wk&amp;&amp;y.wk&lt;312)}function I(b,c,d,e){u=!0,r=e||null,s={success:!1,id:d};var g=P(d);if(g){g.nodeName==&quot;OBJECT&quot;?(p=K(g),q=null):(p=g,q=d),b.id=f;if(typeof b.width==a||!/%$/.test(b.width)&amp;&amp;parseInt(b.width,10)&lt;310)b.width=&quot;310&quot;;if(typeof b.height==a||!/%$/.test(b.height)&amp;&amp;parseInt(b.height,10)&lt;137)b.height=&quot;137&quot;;i.title=i.title.slice(0,47)+&quot; - Flash Player Installation&quot;;var j=y.ie&amp;&amp;y.win?[&quot;Active&quot;].concat(&quot;&quot;).join(&quot;X&quot;):&quot;PlugIn&quot;,k=&quot;MMredirectURL=&quot;+h.location.toString().replace(/&amp;/g,&quot;%26&quot;)+&quot;&amp;MMplayerType=&quot;+j+&quot;&amp;MMdoctitle=&quot;+i.title;typeof c.flashvars!=a?c.flashvars+=&quot;&amp;&quot;+k:c.flashvars=k;if(y.ie&amp;&amp;y.win&amp;&amp;g.readyState!=4){var l=Q(&quot;div&quot;);d+=&quot;SWFObjectNew&quot;,l.setAttribute(&quot;id&quot;,d),g.parentNode.insertBefore(l,g),g.style.display=&quot;none&quot;,function(){g.readyState==4?g.parentNode.removeChild(g):setTimeout(arguments.callee,10)}()}L(b,c,d)}}function J(a){if(y.ie&amp;&amp;y.win&amp;&amp;a.readyState!=4){var b=Q(&quot;div&quot;);a.parentNode.insertBefore(b,a),b.parentNode.replaceChild(K(a),b),a.style.display=&quot;none&quot;,function(){a.readyState==4?a.parentNode.removeChild(a):setTimeout(arguments.callee,10)}()}else a.parentNode.replaceChild(K(a),a)}function K(a){var c=Q(&quot;div&quot;);if(y.win&amp;&amp;y.ie)c.innerHTML=a.innerHTML;else{var d=a.getElementsByTagName(b)[0];if(d){var e=d.childNodes;if(e){var f=e.length;for(var g=0;g&lt;f;g++)(e[g].nodeType!=1||e[g].nodeName!=&quot;PARAM&quot;)&amp;&amp;e[g].nodeType!=8&amp;&amp;c.appendChild(e[g].cloneNode(!0))}}}return c}function L(c,d,f){var g,h=P(f);if(y.wk&amp;&amp;y.wk&lt;312)return g;if(h){typeof c.id==a&amp;&amp;(c.id=f);if(y.ie&amp;&amp;y.win){var i=&quot;&quot;;for(var j in c)c[j]!=Object.prototype[j]&amp;&amp;(j.toLowerCase()==&quot;data&quot;?d.movie=c[j]:j.toLowerCase()==&quot;styleclass&quot;?i+=' class=&quot;'+c[j]+'&quot;':j.toLowerCase()!=&quot;classid&quot;&amp;&amp;(i+=&quot; &quot;+j+'=&quot;'+c[j]+'&quot;'));var k=&quot;&quot;;for(var l in d)d[l]!=Object.prototype[l]&amp;&amp;(k+='&lt;param name=&quot;'+l+'&quot; value=&quot;'+d[l]+'&quot; /&gt;');h.outerHTML='&lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;'+i+&quot;&gt;&quot;+k+&quot;&lt;/object&gt;&quot;,n[n.length]=c.id,g=P(c.id)}else{var m=Q(b);m.setAttribute(&quot;type&quot;,e);for(var o in c)c[o]!=Object.prototype[o]&amp;&amp;(o.toLowerCase()==&quot;styleclass&quot;?m.setAttribute(&quot;class&quot;,c[o]):o.toLowerCase()!=&quot;classid&quot;&amp;&amp;m.setAttribute(o,c[o]));for(var p in d)d[p]!=Object.prototype[p]&amp;&amp;p.toLowerCase()!=&quot;movie&quot;&amp;&amp;M(m,p,d[p]);h.parentNode.replaceChild(m,h),g=m}}return g}function M(a,b,c){var d=Q(&quot;param&quot;);d.setAttribute(&quot;name&quot;,b),d.setAttribute(&quot;value&quot;,c),a.appendChild(d)}function N(a){var b=P(a);b&amp;&amp;b.nodeName==&quot;OBJECT&quot;&amp;&amp;(y.ie&amp;&amp;y.win?(b.style.display=&quot;none&quot;,function(){b.readyState==4?O(a):setTimeout(arguments.callee,10)}()):b.parentNode.removeChild(b))}function O(a){var b=P(a);if(b){for(var c in b)typeof b[c]==&quot;function&quot;&amp;&amp;(b[c]=null);b.parentNode.removeChild(b)}}function P(a){var b=null;try{b=i.getElementById(a)}catch(c){}return b}function Q(a){return i.createElement(a)}function R(a,b,c){a.attachEvent(b,c),o[o.length]=[a,b,c]}function S(a){var b=y.pv,c=a.split(&quot;.&quot;);return c[0]=parseInt(c[0],10),c[1]=parseInt(c[1],10)||0,c[2]=parseInt(c[2],10)||0,b[0]&gt;c[0]||b[0]==c[0]&amp;&amp;b[1]&gt;c[1]||b[0]==c[0]&amp;&amp;b[1]==c[1]&amp;&amp;b[2]&gt;=c[2]?!0:!1}function T(c,d,e,f){if(y.ie&amp;&amp;y.mac)return;var g=i.getElementsByTagName(&quot;head&quot;)[0];if(!g)return;var h=e&amp;&amp;typeof e==&quot;string&quot;?e:&quot;screen&quot;;f&amp;&amp;(v=null,w=null);if(!v||w!=h){var j=Q(&quot;style&quot;);j.setAttribute(&quot;type&quot;,&quot;text/css&quot;),j.setAttribute(&quot;media&quot;,h),v=g.appendChild(j),y.ie&amp;&amp;y.win&amp;&amp;typeof i.styleSheets!=a&amp;&amp;i.styleSheets.length&gt;0&amp;&amp;(v=i.styleSheets[i.styleSheets.length-1]),w=h}y.ie&amp;&amp;y.win?v&amp;&amp;typeof v.addRule==b&amp;&amp;v.addRule(c,d):v&amp;&amp;typeof i.createTextNode!=a&amp;&amp;v.appendChild(i.createTextNode(c+&quot; {&quot;+d+&quot;}&quot;))}function U(a,b){if(!x)return;var c=b?&quot;visible&quot;:&quot;hidden&quot;;t&amp;&amp;P(a)?P(a).style.visibility=c:T(&quot;#&quot;+a,&quot;visibility:&quot;+c)}function V(b){var c=/[\\\&quot;&lt;&gt;\.;]/,d=c.exec(b)!=null;return d&amp;&amp;typeof encodeURIComponent!=a?encodeURIComponent(b):b}var a=&quot;undefined&quot;,b=&quot;object&quot;,c=&quot;Shockwave Flash&quot;,d=&quot;ShockwaveFlash.ShockwaveFlash&quot;,e=&quot;application/x-shockwave-flash&quot;,f=&quot;SWFObjectExprInst&quot;,g=&quot;onreadystatechange&quot;,h=window,i=document,j=navigator,k=!1,l=[D],m=[],n=[],o=[],p,q,r,s,t=!1,u=!1,v,w,x=!0,y=function(){var f=typeof i.getElementById!=a&amp;&amp;typeof i.getElementsByTagName!=a&amp;&amp;typeof i.createElement!=a,g=j.userAgent.toLowerCase(),l=j.platform.toLowerCase(),m=l?/win/.test(l):/win/.test(g),n=l?/mac/.test(l):/mac/.test(g),o=/webkit/.test(g)?parseFloat(g.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,&quot;$1&quot;)):!1,p=!1,q=[0,0,0],r=null;if(typeof j.plugins!=a&amp;&amp;typeof j.plugins[c]==b)r=j.plugins[c].description,r&amp;&amp;(typeof j.mimeTypes==a||!j.mimeTypes[e]||!!j.mimeTypes[e].enabledPlugin)&amp;&amp;(k=!0,p=!1,r=r.replace(/^.*\s+(\S+\s+\S+$)/,&quot;$1&quot;),q[0]=parseInt(r.replace(/^(.*)\..*$/,&quot;$1&quot;),10),q[1]=parseInt(r.replace(/^.*\.(.*)\s.*$/,&quot;$1&quot;),10),q[2]=/[a-zA-Z]/.test(r)?parseInt(r.replace(/^.*[a-zA-Z]+(.*)$/,&quot;$1&quot;),10):0);else if(typeof h[[&quot;Active&quot;].concat(&quot;Object&quot;).join(&quot;X&quot;)]!=a)try{var s=new(window[[&quot;Active&quot;].concat(&quot;Object&quot;).join(&quot;X&quot;)])(d);s&amp;&amp;(r=s.GetVariable(&quot;$version&quot;),r&amp;&amp;(p=!0,r=r.split(&quot; &quot;)[1].split(&quot;,&quot;),q=[parseInt(r[0],10),parseInt(r[1],10),parseInt(r[2],10)]))}catch(t){}return{w3:f,pv:q,wk:o,ie:p,win:m,mac:n}}(),z=function(){if(!y.w3)return;(typeof i.readyState!=a&amp;&amp;i.readyState==&quot;complete&quot;||typeof i.readyState==a&amp;&amp;(i.getElementsByTagName(&quot;body&quot;)[0]||i.body))&amp;&amp;A(),t||(typeof i.addEventListener!=a&amp;&amp;i.addEventListener(&quot;DOMContentLoaded&quot;,A,!1),y.ie&amp;&amp;y.win&amp;&amp;(i.attachEvent(g,function(){i.readyState==&quot;complete&quot;&amp;&amp;(i.detachEvent(g,arguments.callee),A())}),h==top&amp;&amp;function(){if(t)return;try{i.documentElement.doScroll(&quot;left&quot;)}catch(a){setTimeout(arguments.callee,0);return}A()}()),y.wk&amp;&amp;function(){if(t)return;if(!/loaded|complete/.test(i.readyState)){setTimeout(arguments.callee,0);return}A()}(),C(A))}(),W=function(){y.ie&amp;&amp;y.win&amp;&amp;window.attachEvent(&quot;onunload&quot;,function(){var a=o.length;for(var b=0;b&lt;a;b++)o[b][0].detachEvent(o[b][1],o[b][2]);var c=n.length;for(var d=0;d&lt;c;d++)N(n[d]);for(var e in y)y[e]=null;y=null;for(var f in swfobject)swfobject[f]=null;swfobject=null})}();return{registerObject:function(a,b,c,d){if(y.w3&amp;&amp;a&amp;&amp;b){var e={};e.id=a,e.swfVersion=b,e.expressInstall=c,e.callbackFn=d,m[m.length]=e,U(a,!1)}else d&amp;&amp;d({success:!1,id:a})},getObjectById:function(a){if(y.w3)return G(a)},embedSWF:function(c,d,e,f,g,h,i,j,k,l){var m={success:!1,id:d};y.w3&amp;&amp;!(y.wk&amp;&amp;y.wk&lt;312)&amp;&amp;c&amp;&amp;d&amp;&amp;e&amp;&amp;f&amp;&amp;g?(U(d,!1),B(function(){e+=&quot;&quot;,f+=&quot;&quot;;var n={};if(k&amp;&amp;typeof k===b)for(var o in k)n[o]=k[o];n.data=c,n.width=e,n.height=f;var p={};if(j&amp;&amp;typeof j===b)for(var q in j)p[q]=j[q];if(i&amp;&amp;typeof i===b)for(var r in i)typeof p.flashvars!=a?p.flashvars+=&quot;&amp;&quot;+r+&quot;=&quot;+i[r]:p.flashvars=r+&quot;=&quot;+i[r];if(S(g)){var s=L(n,p,d);n.id==d&amp;&amp;U(d,!0),m.success=!0,m.ref=s}else{if(h&amp;&amp;H()){n.data=h,I(n,p,d,l);return}U(d,!0)}l&amp;&amp;l(m)})):l&amp;&amp;l(m)},switchOffAutoHideShow:function(){x=!1},ua:y,getFlashPlayerVersion:function(){return{major:y.pv[0],minor:y.pv[1],release:y.pv[2]}},hasFlashPlayerVersion:S,createSWF:function(a,b,c){return y.w3?L(a,b,c):undefined},showExpressInstall:function(a,b,c,d){y.w3&amp;&amp;H()&amp;&amp;I(a,b,c,d)},removeSWF:function(a){y.w3&amp;&amp;N(a)},createCSS:function(a,b,c,d){y.w3&amp;&amp;T(a,b,c,d)},addDomLoadEvent:B,addLoadEvent:C,getQueryParamValue:function(a){var b=i.location.search||i.location.hash;if(b){/\?/.test(b)&amp;&amp;(b=b.split(&quot;?&quot;)[1]);if(a==null)return V(b);var c=b.split(&quot;&amp;&quot;);for(var d=0;d&lt;c.length;d++)if(c[d].substring(0,c[d].indexOf(&quot;=&quot;))==a)return V(c[d].substring(c[d].indexOf(&quot;=&quot;)+1))}return&quot;&quot;},expressInstallCallback:function(){if(u){var a=P(f);a&amp;&amp;p&amp;&amp;(a.parentNode.replaceChild(p,a),q&amp;&amp;(U(q,!0),y.ie&amp;&amp;y.win&amp;&amp;(p.style.display=&quot;block&quot;)),r&amp;&amp;r(s)),u=!1}}}}();(function(){if(&quot;undefined&quot;==typeof window||window.WebSocket)return;var a=window.console;if(!a||!a.log||!a.error)a={log:function(){},error:function(){}};if(!swfobject.hasFlashPlayerVersion(&quot;10.0.0&quot;)){a.error(&quot;Flash Player &gt;= 10.0.0 is required.&quot;);return}location.protocol==&quot;file:&quot;&amp;&amp;a.error(&quot;WARNING: web-socket-js doesn't work in file:///... URL unless you set Flash Security Settings properly. Open the page via Web server i.e. http://...&quot;),WebSocket=function(a,b,c,d,e){var f=this;f.__id=WebSocket.__nextId++,WebSocket.__instances[f.__id]=f,f.readyState=WebSocket.CONNECTING,f.bufferedAmount=0,f.__events={},b?typeof b==&quot;string&quot;&amp;&amp;(b=[b]):b=[],setTimeout(function(){WebSocket.__addTask(function(){WebSocket.__flash.create(f.__id,a,b,c||null,d||0,e||null)})},0)},WebSocket.prototype.send=function(a){if(this.readyState==WebSocket.CONNECTING)throw&quot;INVALID_STATE_ERR: Web Socket connection has not been established&quot;;var b=WebSocket.__flash.send(this.__id,encodeURIComponent(a));return b&lt;0?!0:(this.bufferedAmount+=b,!1)},WebSocket.prototype.close=function(){if(this.readyState==WebSocket.CLOSED||this.readyState==WebSocket.CLOSING)return;this.readyState=WebSocket.CLOSING,WebSocket.__flash.close(this.__id)},WebSocket.prototype.addEventListener=function(a,b,c){a in this.__events||(this.__events[a]=[]),this.__events[a].push(b)},WebSocket.prototype.removeEventListener=function(a,b,c){if(!(a in this.__events))return;var d=this.__events[a];for(var e=d.length-1;e&gt;=0;--e)if(d[e]===b){d.splice(e,1);break}},WebSocket.prototype.dispatchEvent=function(a){var b=this.__events[a.type]||[];for(var c=0;c&lt;b.length;++c)b[c](a);var d=this[&quot;on&quot;+a.type];d&amp;&amp;d(a)},WebSocket.prototype.__handleEvent=function(a){&quot;readyState&quot;in a&amp;&amp;(this.readyState=a.readyState),&quot;protocol&quot;in a&amp;&amp;(this.protocol=a.protocol);var b;if(a.type==&quot;open&quot;||a.type==&quot;error&quot;)b=this.__createSimpleEvent(a.type);else if(a.type==&quot;close&quot;)b=this.__createSimpleEvent(&quot;close&quot;);else{if(a.type!=&quot;message&quot;)throw&quot;unknown event type: &quot;+a.type;var c=decodeURIComponent(a.message);b=this.__createMessageEvent(&quot;message&quot;,c)}this.dispatchEvent(b)},WebSocket.prototype.__createSimpleEvent=function(a){if(document.createEvent&amp;&amp;window.Event){var b=document.createEvent(&quot;Event&quot;);return b.initEvent(a,!1,!1),b}return{type:a,bubbles:!1,cancelable:!1}},WebSocket.prototype.__createMessageEvent=function(a,b){if(document.createEvent&amp;&amp;window.MessageEvent&amp;&amp;!window.opera){var c=document.createEvent(&quot;MessageEvent&quot;);return c.initMessageEvent(&quot;message&quot;,!1,!1,b,null,null,window,null),c}return{type:a,data:b,bubbles:!1,cancelable:!1}},WebSocket.CONNECTING=0,WebSocket.OPEN=1,WebSocket.CLOSING=2,WebSocket.CLOSED=3,WebSocket.__flash=null,WebSocket.__instances={},WebSocket.__tasks=[],WebSocket.__nextId=0,WebSocket.loadFlashPolicyFile=function(a){WebSocket.__addTask(function(){WebSocket.__flash.loadManualPolicyFile(a)})},WebSocket.__initialize=function(){if(WebSocket.__flash)return;WebSocket.__swfLocation&amp;&amp;(window.WEB_SOCKET_SWF_LOCATION=WebSocket.__swfLocation);if(!window.WEB_SOCKET_SWF_LOCATION){a.error(&quot;[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf&quot;);return}var b=document.createElement(&quot;div&quot;);b.id=&quot;webSocketContainer&quot;,b.style.position=&quot;absolute&quot;,WebSocket.__isFlashLite()?(b.style.left=&quot;0px&quot;,b.style.top=&quot;0px&quot;):(b.style.left=&quot;-100px&quot;,b.style.top=&quot;-100px&quot;);var c=document.createElement(&quot;div&quot;);c.id=&quot;webSocketFlash&quot;,b.appendChild(c),document.body.appendChild(b),swfobject.embedSWF(WEB_SOCKET_SWF_LOCATION,&quot;webSocketFlash&quot;,&quot;1&quot;,&quot;1&quot;,&quot;10.0.0&quot;,null,null,{hasPriority:!0,swliveconnect:!0,allowScriptAccess:&quot;always&quot;},null,function(b){b.success||a.error(&quot;[WebSocket] swfobject.embedSWF failed&quot;)})},WebSocket.__onFlashInitialized=function(){setTimeout(function(){WebSocket.__flash=document.getElementById(&quot;webSocketFlash&quot;),WebSocket.__flash.setCallerUrl(location.href),WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);for(var a=0;a&lt;WebSocket.__tasks.length;++a)WebSocket.__tasks[a]();WebSocket.__tasks=[]},0)},WebSocket.__onFlashEvent=function(){return setTimeout(function(){try{var b=WebSocket.__flash.receiveEvents();for(var c=0;c&lt;b.length;++c)WebSocket.__instances[b[c].webSocketId].__handleEvent(b[c])}catch(d){a.error(d)}},0),!0},WebSocket.__log=function(b){a.log(decodeURIComponent(b))},WebSocket.__error=function(b){a.error(decodeURIComponent(b))},WebSocket.__addTask=function(a){WebSocket.__flash?a():WebSocket.__tasks.push(a)},WebSocket.__isFlashLite=function(){if(!window.navigator||!window.navigator.mimeTypes)return!1;var a=window.navigator.mimeTypes[&quot;application/x-shockwave-flash&quot;];return!a||!a.enabledPlugin||!a.enabledPlugin.filename?!1:a.enabledPlugin.filename.match(/flashlite/i)?!0:!1},window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION||(window.addEventListener?window.addEventListener(&quot;load&quot;,function(){WebSocket.__initialize()},!1):window.attachEvent(&quot;onload&quot;,function(){WebSocket.__initialize()}))})(),function(a,b,c){function d(a){if(!a)return;b.Transport.apply(this,arguments),this.sendBuffer=[]}function e(){}a.XHR=d,b.util.inherit(d,b.Transport),d.prototype.open=function(){return this.socket.setBuffer(!1),this.onOpen(),this.get(),this.setCloseTimeout(),this},d.prototype.payload=function(a){var c=[];for(var d=0,e=a.length;d&lt;e;d++)c.push(b.parser.encodePacket(a[d]));this.send(b.parser.encodePayload(c))},d.prototype.send=function(a){return this.post(a),this},d.prototype.post=function(a){function d(){this.readyState==4&amp;&amp;(this.onreadystatechange=e,b.posting=!1,this.status==200?b.socket.setBuffer(!1):b.onClose())}function f(){this.onload=e,b.socket.setBuffer(!1)}var b=this;this.socket.setBuffer(!0),this.sendXHR=this.request(&quot;POST&quot;),c.XDomainRequest&amp;&amp;this.sendXHR instanceof XDomainRequest?this.sendXHR.onload=this.sendXHR.onerror=f:this.sendXHR.onreadystatechange=d,this.sendXHR.send(a)},d.prototype.close=function(){return this.onClose(),this},d.prototype.request=function(a){var c=b.util.request(this.socket.isXDomain()),d=b.util.query(this.socket.options.query,&quot;t=&quot;+ +(new Date));c.open(a||&quot;GET&quot;,this.prepareUrl()+d,!0);if(a==&quot;POST&quot;)try{c.setRequestHeader?c.setRequestHeader(&quot;Content-type&quot;,&quot;text/plain;charset=UTF-8&quot;):c.contentType=&quot;text/plain&quot;}catch(e){}return c},d.prototype.scheme=function(){return this.socket.options.secure?&quot;https&quot;:&quot;http&quot;},d.check=function(a,d){try{var e=b.util.request(d),f=c.XDomainRequest&amp;&amp;e instanceof XDomainRequest,g=a&amp;&amp;a.options&amp;&amp;a.options.secure?&quot;https:&quot;:&quot;http:&quot;,h=c.location&amp;&amp;g!=c.location.protocol;if(e&amp;&amp;(!f||!h))return!0}catch(i){}return!1},d.xdomainCheck=function(a){return d.check(a,!0)}}(&quot;undefined&quot;!=typeof io?io.Transport:module.exports,&quot;undefined&quot;!=typeof io?io:module.parent.exports,this),function(a,b){function c(a){b.Transport.XHR.apply(this,arguments)}a.htmlfile=c,b.util.inherit(c,b.Transport.XHR),c.prototype.name=&quot;htmlfile&quot;,c.prototype.get=function(){this.doc=new(window[[&quot;Active&quot;].concat(&quot;Object&quot;).join(&quot;X&quot;)])(&quot;htmlfile&quot;),this.doc.open(),this.doc.write(&quot;&lt;html&gt;&lt;/html&gt;&quot;),this.doc.close(),this.doc.parentWindow.s=this;var a=this.doc.createElement(&quot;div&quot;);a.className=&quot;socketio&quot;,this.doc.body.appendChild(a),this.iframe=this.doc.createElement(&quot;iframe&quot;),a.appendChild(this.iframe);var c=this,d=b.util.query(this.socket.options.query,&quot;t=&quot;+ +(new Date));this.iframe.src=this.prepareUrl()+d,b.util.on(window,&quot;unload&quot;,function(){c.destroy()})},c.prototype._=function(a,b){this.onData(a);try{var c=b.getElementsByTagName(&quot;script&quot;)[0];c.parentNode.removeChild(c)}catch(d){}},c.prototype.destroy=function(){if(this.iframe){try{this.iframe.src=&quot;about:blank&quot;}catch(a){}this.doc=null,this.iframe.parentNode.removeChild(this.iframe),this.iframe=null,CollectGarbage()}},c.prototype.close=function(){return this.destroy(),b.Transport.XHR.prototype.close.call(this)},c.check=function(a){if(typeof window!=&quot;undefined&quot;&amp;&amp;[&quot;Active&quot;].concat(&quot;Object&quot;).join(&quot;X&quot;)in window)try{var c=new(window[[&quot;Active&quot;].concat(&quot;Object&quot;).join(&quot;X&quot;)])(&quot;htmlfile&quot;);return c&amp;&amp;b.Transport.XHR.check(a)}catch(d){}return!1},c.xdomainCheck=function(){return!1},b.transports.push(&quot;htmlfile&quot;)}(&quot;undefined&quot;!=typeof io?io.Transport:module.exports,&quot;undefined&quot;!=typeof io?io:module.parent.exports),function(a,b,c){function d(){b.Transport.XHR.apply(this,arguments)}function e(){}a[&quot;xhr-polling&quot;]=d,b.util.inherit(d,b.Transport.XHR),b.util.merge(d,b.Transport.XHR),d.prototype.name=&quot;xhr-polling&quot;,d.prototype.heartbeats=function(){return!1},d.prototype.open=function(){var a=this;return b.Transport.XHR.prototype.open.call(a),!1},d.prototype.get=function(){function b(){this.readyState==4&amp;&amp;(this.onreadystatechange=e,this.status==200?(a.onData(this.responseText),a.get()):a.onClose())}function d(){this.onload=e,this.onerror=e,a.retryCounter=1,a.onData(this.responseText),a.get()}function f(){a.retryCounter++,!a.retryCounter||a.retryCounter&gt;3?a.onClose():a.get()}if(!this.isOpen)return;var a=this;this.xhr=this.request(),c.XDomainRequest&amp;&amp;this.xhr instanceof XDomainRequest?(this.xhr.onload=d,this.xhr.onerror=f):this.xhr.onreadystatechange=b,this.xhr.send(null)},d.prototype.onClose=function(){b.Transport.XHR.prototype.onClose.call(this);if(this.xhr){this.xhr.onreadystatechange=this.xhr.onload=this.xhr.onerror=e;try{this.xhr.abort()}catch(a){}this.xhr=null}},d.prototype.ready=function(a,c){var d=this;b.util.defer(function(){c.call(d)})},b.transports.push(&quot;xhr-polling&quot;)}(&quot;undefined&quot;!=typeof io?io.Transport:module.exports,&quot;undefined&quot;!=typeof io?io:module.parent.exports,this),function(a,b,c){function e(a){b.Transport[&quot;xhr-polling&quot;].apply(this,arguments),this.index=b.j.length;var c=this;b.j.push(function(a){c._(a)})}var d=c.document&amp;&amp;&quot;MozAppearance&quot;in c.document.documentElement.style;a[&quot;jsonp-polling&quot;]=e,b.util.inherit(e,b.Transport[&quot;xhr-polling&quot;]),e.prototype.name=&quot;jsonp-polling&quot;,e.prototype.post=function(a){function i(){j(),c.socket.setBuffer(!1)}function j(){c.iframe&amp;&amp;c.form.removeChild(c.iframe);try{h=document.createElement('&lt;iframe name=&quot;'+c.iframeId+'&quot;&gt;')}catch(a){h=document.createElement(&quot;iframe&quot;),h.name=c.iframeId}h.id=c.iframeId,c.form.appendChild(h),c.iframe=h}var c=this,d=b.util.query(this.socket.options.query,&quot;t=&quot;+ +(new Date)+&quot;&amp;i=&quot;+this.index);if(!this.form){var e=document.createElement(&quot;form&quot;),f=document.createElement(&quot;textarea&quot;),g=this.iframeId=&quot;socketio_iframe_&quot;+this.index,h;e.className=&quot;socketio&quot;,e.style.position=&quot;absolute&quot;,e.style.top=&quot;0px&quot;,e.style.left=&quot;0px&quot;,e.style.display=&quot;none&quot;,e.target=g,e.method=&quot;POST&quot;,e.setAttribute(&quot;accept-charset&quot;,&quot;utf-8&quot;),f.name=&quot;d&quot;,e.appendChild(f),document.body.appendChild(e),this.form=e,this.area=f}this.form.action=this.prepareUrl()+d,j(),this.area.value=b.JSON.stringify(a);try{this.form.submit()}catch(k){}this.iframe.attachEvent?h.onreadystatechange=function(){c.iframe.readyState==&quot;complete&quot;&amp;&amp;i()}:this.iframe.onload=i,this.socket.setBuffer(!0)},e.prototype.get=function(){var a=this,c=document.createElement(&quot;script&quot;),e=b.util.query(this.socket.options.query,&quot;t=&quot;+ +(new Date)+&quot;&amp;i=&quot;+this.index);this.script&amp;&amp;(this.script.parentNode.removeChild(this.script),this.script=null),c.async=!0,c.src=this.prepareUrl()+e,c.onerror=function(){a.onClose()};var f=document.getElementsByTagName(&quot;script&quot;)[0];f.parentNode.insertBefore(c,f),this.script=c,d&amp;&amp;setTimeout(function(){var a=document.createElement(&quot;iframe&quot;);document.body.appendChild(a),document.body.removeChild(a)},100)},e.prototype._=function(a){return this.onData(a),this.isOpen&amp;&amp;this.get(),this},e.prototype.ready=function(a,c){var e=this;if(!d)return c.call(this);b.util.load(function(){c.call(e)})},e.check=function(){return&quot;document&quot;in c},e.xdomainCheck=function(){return!0},b.transports.push(&quot;jsonp-polling&quot;)}(&quot;undefined&quot;!=typeof io?io.Transport:module.exports,&quot;undefined&quot;!=typeof io?io:module.parent.exports,this),typeof define==&quot;function&quot;&amp;&amp;define.amd&amp;&amp;define([],function(){return io})})()</div></pre></div>
664          </td>
interface.cpp https://github.com/brotchie/rzmq.git | C++ | 791 lines
84static void socketFinalizer(SEXP socket_) {
85  zmq::socket_t* socket = reinterpret_cast<zmq::socket_t*>(checkExternalPointer(socket_,"zmq::socket_t*"));
86  if(socket) {
208        for (int i = 0; i < nsock; i++) {
209            zmq::socket_t* socket = reinterpret_cast<zmq::socket_t*>(checkExternalPointer(VECTOR_ELT(sockets_, i), "zmq::socket_t*"));
210            pitems[i].socket = (void*)*socket;
440  try {
441    zmq::socket_t* socket = reinterpret_cast<zmq::socket_t*>(checkExternalPointer(socket_,"zmq::socket_t*"));
442    status = socket->recv(&msg);
478
479  zmq::socket_t* socket = reinterpret_cast<zmq::socket_t*>(checkExternalPointer(socket_,"zmq::socket_t*"));
480  if(!socket) { REprintf("bad socket object.\n");return R_NilValue; }
747
748  zmq::socket_t* socket = reinterpret_cast<zmq::socket_t*>(checkExternalPointer(socket_,"zmq::socket_t*"));
749  if(!socket) { REprintf("bad socket object.\n");return R_NilValue; }
socket.cpp https://github.com/zrecommerce/Adafruit_CC3000_Library.git | C++ | 1,191 lines
250	// Initiate a HCI command
251	hci_command_send(HCI_CMND_CLOSE_SOCKET, ptr, SOCKET_CLOSE_PARAMS_LEN);
252	
518//!  @brief  initiate a connection on a socket 
519//!          Function connects the socket referred to by the socket descriptor 
520//!          sd, to the address specified by addr. The addrlen argument 
526//!          If the socket is of type SOCK_STREAM, this call attempts to make a 
527//!          connection to another socket. The other socket is specified  by 
528//!          address, which is an address in the communications space of the
890	DEBUGPRINT_F("\n\r\tRecv'd data... Socket #");
891	DEBUGPRINT_DEC(tSocketReadEvent.iSocketDescriptor);
892	DEBUGPRINT_F(" Bytes: 0x");
964//!                 function receives a message from a connection-mode or
965//!                 connectionless-mode socket. Note that raw sockets are not
966//!                 supported.
Sockets.tex https://github.com/KWMalik/PharoByExample-english.git | LaTeX | 695 lines
46
47The concept of socket was first introduced by researchers from Berkeley University in the 1960s. They defined the first socket API for the C programming language in the context of Unix operating systems. Since then, the concept of socket was spread out to other operating systems. 
48Its API was ported to most existing programming languages including Smalltalk.
171
172\Scrref{dataExhangeWithTcpSocket} shows the protocol to send and receive data through a client socket.
173Here, we send the string \ct-'Hello server!'- to the server using the \ct!sendData:! message.
254\item Wait for connections by making \textit{socket$_1$}  listen on some port.
255\item Accept a client request for connection. As a result, \textit{socket$_1$} will build a second socket labelled \textit{socket$_2$}.
256\item Exchange data with the client through \textit{socket$_2$}. In the meanwhile, \textit{socket$_1$} can continue to wait for connections, and possibly create new sockets to exchange data with other clients. 
292If no client attempts to connect during these 60 seconds, the message answers \ct!nil!.
293Otherwise, we get a new socket \ct!interactionSocket! connected the client's socket.
294At this point, we do not need the connection socket anymore, so we can close it (\ct!connectionSocket closeAndDestroy! message).
689
690% Noury: Pour pousser le message "Utilisez les SocketStream", est-ce Ben tu pourras remplacer les socket par des SocketStream dans ton code ?
691% Reference to a chat instant messages:  on Squeaksource: http://www.squeaksource.com/PharoInstantMessenge \ben{maybe it should be moved in another repo}. You can load it using Monticello (Chapter \ja{numChapter}).
gen_smtp_client.erl https://github.com/JackDanger/gen_smtp.git | Erlang | 974 lines
268
269-spec try_AUTH(Socket :: socket:socket(), Options :: list(), AuthTypes :: [string()]) -> boolean().
270try_AUTH(Socket, Options, []) ->
316
317-spec do_AUTH(Socket :: socket:socket(), Username :: string(), Password :: string(), Types :: [string()]) -> boolean().
318do_AUTH(Socket, Username, Password, Types) ->
325
326-spec do_AUTH_each(Socket :: socket:socket(), Username :: string() | binary(), Password :: string() | binary(), AuthTypes :: [string()]) -> boolean().
327do_AUTH_each(_Socket, _Username, _Password, []) ->
403% check if we should try to do TLS
404-spec try_STARTTLS(Socket :: socket:socket(), Options :: list(), Extensions :: list()) -> {socket:socket(), list()}.
405try_STARTTLS(Socket, Options, Extensions) ->
429%% attempt to upgrade socket to TLS
430-spec do_STARTTLS(Socket :: socket:socket(), Options :: list()) -> {socket:socket(), list()} | false.
431do_STARTTLS(Socket, Options) ->
test_mem_cache.rb https://github.com/jsl/memcache-client.git | Ruby | 1,170 lines
23
24class FakeSocket
25
88    @port = 11211
89    @socket = socket || FakeSocket.new
90    @weight = 1
277  def test_cache_get_miss
278    socket = FakeSocket.new
279    socket.data.write "END\r\n"
996  def test_flush_all_failure
997    socket = FakeSocket.new
998
1027  def test_stats
1028    socket = FakeSocket.new
1029    socket.data.write "STAT pid 20188\r\nSTAT total_items 32\r\nSTAT version 1.2.3\r\nSTAT rusage_user 1:300\r\nSTAT dummy ok\r\nEND\r\n"
http_socket.test.php https://github.com/msadouni/cakephp2x.git | PHP | 1,463 lines
23
24class TestHttpSocket extends HttpSocket {
25
279/**
280 * Tests that HttpSocket::request (the heart of the HttpSocket) is working properly.
281 *
1050
1051		$r = $this->Socket->buildUri(array('host' => 'www.cakephp.org', 'path' => '/search', 'query' => array('q' => 'HttpSocket')));
1052		$this->assertIdentical($r, 'http://www.cakephp.org/search?q=HttpSocket');
1410/**
1411 * This tests asserts HttpSocket::reset() resets a HttpSocket instance to it's initial state (before Object::__construct
1412 * got executed)
1434/**
1435 * This tests asserts HttpSocket::reset(false) resets certain HttpSocket properties to their initial state (before
1436 * Object::__construct got executed).
packed-refs https://github.com/gitpan/IO-Socket-SSL.git | Unknown | 623 lines
694ae970220d5746a30d220682a58fc8ec5f8409f refs/tags/alpha
72dced17eb3115503f97493d32222fe6fc22acbf9 refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.70.tar.gz
8f82cb1cbe03338a6a19a00372d1787a6896874bc refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.72.tar.gz
8f82cb1cbe03338a6a19a00372d1787a6896874bc refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.72.tar.gz
94db0ce2673ae7da743f35bd6e842e19787108e50 refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.73.tar.gz
105b42b99deef0641541711aec03784b329d96cb70 refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.74.tar.gz
105b42b99deef0641541711aec03784b329d96cb70 refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.74.tar.gz
117bdf0e36f6cbdd9de43e503f8301a46423681d65 refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.75.tar.gz
121ee31e3078a915a181bd6de4d62c3f2e7cd935da refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.76.tar.gz
121ee31e3078a915a181bd6de4d62c3f2e7cd935da refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.76.tar.gz
13c629ba583834dbaa2434ebe0872b74a7ebfd8bac refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.77.tar.gz
1488a733e8d0ed569f3df85af75cac3a9a490095c5 refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.78.tar.gz
1488a733e8d0ed569f3df85af75cac3a9a490095c5 refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.78.tar.gz
15dfec2de35c23ea8d54710378a6569af56923860d refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.79.tar.gz
16d1e9ddbd8a386a39899805aea878e2ae40fd0c72 refs/tags/cpan_path/ASPA/IO-Socket-SSL-0.80.tar.gz
gen_smtp_server_session.erl https://github.com/pedroaxl/gen_smtp.git | Erlang | 2,252 lines
138		<<>> -> ok; % no remaining data
139		_ -> self() ! {socket:get_proto(Socket), Socket, Rest}
140	end,
1849										%ssl:send(Socket, "EHLO somehost.com\r\n"),
1850										%receive {ssl, Socket, Packet5} -> socket:active_once(Socket) end,
1851										%?assertEqual("Foo", Packet5),
1892										socket:send(Socket, "EHLO somehost.com\r\n"),
1893										receive {ssl, Socket, Packet5} -> socket:active_once(Socket) end,
1894										?assertMatch("250-localhost\r\n",  Packet5),
1955										socket:send(Socket, "EHLO somehost.com\r\n"),
1956										receive {ssl, Socket, Packet5} -> socket:active_once(Socket) end,
1957										?assertMatch("250-localhost\r\n",  Packet5),
1978										socket:send(Socket, "STARTTLS\r\n"),
1979										receive {ssl, Socket, Packet6} -> socket:active_once(Socket) end,
1980										?assertMatch("500 "++_, Packet6)
ws_SUITE.erl https://github.com/si14/cowboy.git | Erlang | 580 lines
92		{"localhost", [
93			{"/websocket", websocket_handler, []},
94			{"/ws_echo_handler", websocket_echo_handler, []},
94			{"/ws_echo_handler", websocket_echo_handler, []},
95			{"/ws_init_shutdown", websocket_handler_init_shutdown, []},
96			{"/ws_send_many", ws_send_many_handler, [
125	{port, Port} = lists:keyfind(port, 1, Config),
126	{ok, Socket} = gen_tcp:connect("localhost", Port,
127		[binary, {active, false}, {packet, raw}]),
127		[binary, {active, false}, {packet, raw}]),
128	ok = gen_tcp:send(Socket,
129		"GET /websocket HTTP/1.1\r\n"
171	{ok, << 1:1, 0:3, 1:4, 0:1, 16:7, "websocket_handle" >>}
172		= gen_tcp:recv(Socket, 0, 6000),
173	{ok, << 1:1, 0:3, 1:4, 0:1, 16:7, "websocket_handle" >>}
socket.io.js https://github.com/eiriklv/socket.io.git | JavaScript | 1,167 lines
187        request(srv)
188        .get('/socket.io/socket.io.js')
189        .end(function(err, res){
364          sio.of('/news', function(socket){
365            expect(socket).to.be.a(Socket);
366            --total || done();
1027  describe('middleware', function(done){
1028    var Socket = require('../lib/socket');
1029
1034      sio.use(function(socket, next){
1035        expect(socket).to.be.a(Socket);
1036        run++;
1039      sio.use(function(socket, next){
1040        expect(socket).to.be.a(Socket);
1041        run++;
shd-socket.c https://github.com/amiller/shadow.git | C | 432 lines
71
72void socket_init(Socket* socket, SocketFunctionTable* vtable, DescriptorType type, gint handle,
73		guint receiveBufferSize, guint sendBufferSize) {
90	Descriptor* descriptor = (Descriptor *)socket;
91	tracker_addSocket(tracker, descriptor->handle, socket->protocol, socket->inputBufferSize, socket->outputBufferSize);
92}
176
177gboolean socket_getSocketName(Socket* socket, in_addr_t* ip, in_port_t* port) {
178	MAGIC_ASSERT(socket);
194
195void socket_setSocketName(Socket* socket, in_addr_t ip, in_port_t port, gboolean isInternal) {
196	MAGIC_ASSERT(socket);
416    MAGIC_ASSERT(socket);
417    socket->flags = isUnixSocket ? (socket->flags | SF_UNIX) : (socket->flags & ~SF_UNIX);
418}
transformer.base.js https://github.com/eiriklv/primus.git | JavaScript | 1,252 lines
43      destroy = services.destroy;
44      Socket = services.Socket;
45      server = services.server;
262      it('sends & receives messages', function (done) {
263        var socket = new Socket(server.addr);
264
1182
1183            var socket = new Socket(server.addr);
1184          });
1209
1210            var socket = new Socket(server.addr);
1211            socket.write('foo');
1229
1230            var socket = new Socket(server.addr);
1231            socket.write('foo');
socket.io.js https://github.com/petey/socket.io-client.git | JavaScript | 5,966 lines
1445
1446Socket.Socket = Socket;
1447Socket.Transport = require('./transport');
1506  var transport;
1507  if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') != -1) {
1508    transport = 'websocket';
1581        self.emit('upgrading', transport);
1582        Socket.priorWebsocketSuccess = 'websocket' == transport.name;
1583
1679  this.readyState = 'open';
1680  Socket.priorWebsocketSuccess = 'websocket' == this.transport.name;
1681  this.emit('open');
4299
4300var WebSocket = global.WebSocket || global.MozWebSocket;
4301
GCDAsyncSocket.h https://github.com/lujingyu/XMPPFramework.git | C++ Header | 1,176 lines
851 * Here's how you would accomplish something like that:
852 * - (dispatch_queue_t)newSocketQueueForConnectionFromAddress:(NSData *)address onSocket:(GCDAsyncSocket *)sock
853 * {
861 * }
862 * - (void)socket:(GCDAsyncSocket *)sock didAcceptNewSocket:(GCDAsyncSocket *)newSocket
863 * {
1024 * This method is called immediately prior to socket:didAcceptNewSocket:.
1025 * It optionally allows a listening socket to specify the socketQueue for a new accepted socket.
1026 * If this method is not implemented, or returns NULL, the new accepted socket will create its own default queue.
1040**/
1041- (dispatch_queue_t)newSocketQueueForConnectionFromAddress:(NSData *)address onSocket:(GCDAsyncSocket *)sock;
1042
1052**/
1053- (void)socket:(GCDAsyncSocket *)sock didAcceptNewSocket:(GCDAsyncSocket *)newSocket;
1054
server.js https://github.com/ifraixedes/engine.io.git | JavaScript | 1,765 lines
419      var engine = listen(opts, function (port) {
420        var socket = new eioc.Socket('ws://localhost:%d'.s(port), { transports: ['websocket'] })
421          , total = 2;
892      var engine = listen(opts, function (port) {
893        var socket = new eioc.Socket('ws://localhost:%d'.s(port), { transports: ['websocket'] });
894        engine.on('connection', function (conn) {
945      var engine = listen(opts, function(port) {
946        var socket = new eioc.Socket('ws://localhost:%d'.s(port), { transports: ['websocket'] });
947
971      var engine = listen(opts, function(port) {
972        var socket = new eioc.Socket('ws://localhost:%d'.s(port), { transports: ['websocket'] });
973
1438        var engine = listen({ allowUpgrades: false }, function (port) {
1439          var socket = new eioc.Socket('ws://localhost:%d'.s(port), { transports: ['websocket'] });
1440          var i = 0;
sockets.php https://github.com/sad1990/--.git | PHP | 1,371 lines
245 * @param socket resource <p>
246 * A valid socket resource created with socket_create.
247 * </p>
1230 */
1231function socket_sendmsg ($socket, array $message, $flags) {}
1232
1243 */
1244function socket_recvmsg ($socket, $message, $flags = null) {}
1245
1261 */
1262function socket_getopt ($socket, $level, $optname) {}
1263
1269 */
1270function socket_setopt ($socket, $level, $optname, $optval) {}
1271
socket.io.js https://github.com/Panoptico/NetSense.git | JavaScript | 6,173 lines
1650
1651Socket.Socket = Socket;
1652Socket.Transport = require('./transport');
1711  var transport;
1712  if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') != -1) {
1713    transport = 'websocket';
1786        self.emit('upgrading', transport);
1787        Socket.priorWebsocketSuccess = 'websocket' == transport.name;
1788
1884  this.readyState = 'open';
1885  Socket.priorWebsocketSuccess = 'websocket' == this.transport.name;
1886  this.emit('open');
4493
4494var WebSocket = global.WebSocket || global.MozWebSocket;
4495
HttpSocketTest.php https://github.com/brendo10x/Sistema-de-mercadinho.git | PHP | 1,765 lines
311/**
312 * Tests that HttpSocket::request (the heart of the HttpSocket) is working properly.
313 *
1433
1434		$r = $this->Socket->buildUri(array('host' => 'www.cakephp.org', 'path' => '/search', 'query' => array('q' => 'HttpSocket')));
1435		$this->assertEquals('http://www.cakephp.org/search?q=HttpSocket', $r);
1677/**
1678 * This tests asserts HttpSocket::reset() resets a HttpSocket instance to it's initial state (before Object::__construct
1679 * got executed)
1700/**
1701 * This tests asserts HttpSocket::reset(false) resets certain HttpSocket properties to their initial state (before
1702 * Object::__construct got executed).
1752		$this->skipIf(!extension_loaded('openssl'), 'OpenSSL is not enabled cannot test SSL.');
1753		$socket = new HttpSocket();
1754		try {
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21