Sha256: c07358eee1f4963bd151c09b7c4846721f610971f416a4a70cba8f32858e3e6a
Contents?: true
Size: 772 Bytes
Versions: 62
Compression:
Stored size: 772 Bytes
Contents
sp_to_sockio = {} function if_sockio_init(url, sp) { sp_to_sockio[sp] = io(url, { "forceNew": true }); } function if_sockio_fwd(sp, event_name, bp) { //Grab socket var socket = sp_to_sockio[sp]; if (socket) { //Forward events socket.on(event_name, function(info) { int_dispatch([3, "int_event", bp, event_name, info]); }); } else { <% if @debug %> console.error("Couldnt fwd sockio with sp: " + sp + " (It dspn't exist)"); <% end %> } } function if_sockio_send(sp, event_name, info) { //Grab socket var socket = sp_to_sockio[sp]; if (socket) { socket.emit(event_name, info); } else { <% if @debug %> console.error("Couldnt fwd sockio with sp: " + sp + " (It dspn't exist)"); <% end %> } }
Version data entries
62 entries across 62 versions & 1 rubygems