mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-09 15:08:12 -05:00
17 lines
316 B
JavaScript
17 lines
316 B
JavaScript
/* global importScripts,eio,postMessage */
|
|
|
|
importScripts("/test/support/engine.io.min.js");
|
|
|
|
var socket = eio();
|
|
|
|
var count = 0;
|
|
socket.on("message", function (msg) {
|
|
count++;
|
|
if (count < 10) {
|
|
socket.send("give utf8");
|
|
} else if (count < 20) {
|
|
socket.send("give binary");
|
|
}
|
|
postMessage(msg);
|
|
});
|