-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
29 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"author": "Ma Bingyao <[email protected]>", | ||
"name": "hprose", | ||
"version": "2.0.22", | ||
"version": "2.0.23", | ||
"description": "Hprose is a High Performance Remote Object Service Engine.", | ||
"keywords": [ | ||
"hprose", | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Hprose for JavaScript v2.0.22 | ||
// Hprose for JavaScript v2.0.23 | ||
// Copyright (c) 2008-2016 http://hprose.com | ||
// Hprose is freely distributable under the MIT license. | ||
// For all details and documentation: | ||
|
@@ -6804,7 +6804,7 @@ | |
* * | ||
* hprose websocket client for JavaScript. * | ||
* * | ||
* LastModified: Sep 29, 2016 * | ||
* LastModified: Nov 18, 2016 * | ||
* Author: Ma Bingyao <[email protected]> * | ||
* * | ||
\**********************************************************/ | ||
|
@@ -6913,13 +6913,8 @@ | |
ws.onclose = onclose; | ||
} | ||
function sendAndReceive(request, env) { | ||
if (ws === null || | ||
ws.readyState === WebSocket.CLOSING || | ||
ws.readyState === WebSocket.CLOSED) { | ||
connect(); | ||
} | ||
var future = new Future(); | ||
var id = getNextId(); | ||
var future = new Future(); | ||
_futures[id] = future; | ||
_envs[id] = env; | ||
if (env.timeout > 0) { | ||
|
@@ -6932,6 +6927,11 @@ | |
return e instanceof TimeoutError; | ||
}); | ||
} | ||
if (ws === null || | ||
ws.readyState === WebSocket.CLOSING || | ||
ws.readyState === WebSocket.CLOSED) { | ||
connect(); | ||
} | ||
if (_count < 100) { | ||
++_count; | ||
_ready.then(function() { send(id, request); }); | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
* * | ||
* hprose websocket client for JavaScript. * | ||
* * | ||
* LastModified: Nov 16, 2016 * | ||
* LastModified: Nov 18, 2016 * | ||
* Author: Ma Bingyao <[email protected]> * | ||
* * | ||
\**********************************************************/ | ||
|
@@ -112,6 +112,7 @@ | |
ws = null; | ||
} | ||
function connect() { | ||
_ready = new Future(); | ||
ws = new WebSocket(self.uri()); | ||
ws.binaryType = 'arraybuffer'; | ||
ws.onopen = onopen; | ||
|
@@ -120,13 +121,8 @@ | |
ws.onclose = onclose; | ||
} | ||
function sendAndReceive(request, env) { | ||
if (ws === null || | ||
ws.readyState === WebSocket.CLOSING || | ||
ws.readyState === WebSocket.CLOSED) { | ||
_ready = new Future(); | ||
} | ||
var future = new Future(); | ||
var id = getNextId(); | ||
var future = new Future(); | ||
_futures[id] = future; | ||
_envs[id] = env; | ||
if (env.timeout > 0) { | ||
|
@@ -139,18 +135,18 @@ | |
return e instanceof TimeoutError; | ||
}); | ||
} | ||
if (ws === null || | ||
ws.readyState === WebSocket.CLOSING || | ||
ws.readyState === WebSocket.CLOSED) { | ||
connect(); | ||
} | ||
if (_count < 100) { | ||
++_count; | ||
_ready.then(function() { send(id, request); }); | ||
} | ||
else { | ||
_requests.push([id, request]); | ||
} | ||
if (ws === null || | ||
ws.readyState === WebSocket.CLOSING || | ||
ws.readyState === WebSocket.CLOSED) { | ||
connect(); | ||
} | ||
if (env.oneway) { future.resolve(); } | ||
return future; | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.