• Home
  • Raw
  • Download

Lines Matching refs:WebSocket

10   } else if (window.WebSocket) {
14 window.WebSocket = MozWebSocket;
48 window.WebSocket = function(url, protocols, proxyHost, proxyPort, headers) { class in window
50 self.__id = WebSocket.__nextId++;
51 WebSocket.__instances[self.__id] = self;
52 self.readyState = WebSocket.CONNECTING;
63 WebSocket.__addTask(function() {
65 WebSocket.__flash.create(
76 WebSocket.prototype.send = function(data) { class
77 if (this.readyState == WebSocket.CONNECTING) {
88 var result = WebSocket.__flash.send(this.__id, encodeURIComponent(data));
100 WebSocket.prototype.close = function() {
104 this.readyState = WebSocket.CLOSED;
107 if (this.readyState == WebSocket.CLOSED || this.readyState == WebSocket.CLOSING) {
110 this.readyState = WebSocket.CLOSING;
111 WebSocket.__flash.close(this.__id);
122 WebSocket.prototype.addEventListener = function(type, listener, useCapture) {
137 WebSocket.prototype.removeEventListener = function(type, listener, useCapture) {
154 WebSocket.prototype.dispatchEvent = function(event) {
167 WebSocket.prototype.__handleEvent = function(flashEvent) {
195 WebSocket.prototype.__createSimpleEvent = function(type) {
205 WebSocket.prototype.__createMessageEvent = function(type, data) {
219 WebSocket.CONNECTING = 0;
220 WebSocket.OPEN = 1;
221 WebSocket.CLOSING = 2;
222 WebSocket.CLOSED = 3;
225 WebSocket.__isFlashImplementation = true;
226 WebSocket.__initialized = false;
227 WebSocket.__flash = null;
228 WebSocket.__instances = {};
229 WebSocket.__tasks = [];
230 WebSocket.__nextId = 0;
236 WebSocket.loadFlashPolicyFile = function(url){
237 WebSocket.__addTask(function() {
238 WebSocket.__flash.loadManualPolicyFile(url);
245 WebSocket.__initialize = function() {
247 if (WebSocket.__initialized) return;
248 WebSocket.__initialized = true;
250 if (WebSocket.__swfLocation) {
252 window.WEB_SOCKET_SWF_LOCATION = WebSocket.__swfLocation;
279 if (WebSocket.__isFlashLite()) {
315 WebSocket.__onFlashInitialized = function() {
319 WebSocket.__flash = document.getElementById("webSocketFlash");
320 WebSocket.__flash.setCallerUrl(location.href);
321 WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);
322 for (var i = 0; i < WebSocket.__tasks.length; ++i) {
323 WebSocket.__tasks[i]();
325 WebSocket.__tasks = [];
332 WebSocket.__onFlashEvent = function() {
338 var events = WebSocket.__flash.receiveEvents();
340 WebSocket.__instances[events[i].webSocketId].__handleEvent(events[i]);
350 WebSocket.__log = function(message) {
355 WebSocket.__error = function(message) {
359 WebSocket.__addTask = function(task) {
360 if (WebSocket.__flash) {
363 WebSocket.__tasks.push(task);
371 WebSocket.__isFlashLite = function() {
387 WebSocket.__initialize();