mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04:58 +00:00
Update pipe-ipc.js
This commit is contained in:
parent
3294e23e59
commit
1ed17cc5c0
|
@ -44,13 +44,17 @@ function PipeIPC() {
|
|||
this.reader = null;
|
||||
};
|
||||
|
||||
this._write = function(message) {
|
||||
this.writer.Write(message);
|
||||
};
|
||||
|
||||
this.write = function(message) {
|
||||
var isWritten = false;
|
||||
|
||||
while (!isWritten) {
|
||||
try {
|
||||
this.createWriter();
|
||||
this.writer.Write(message);
|
||||
this._write(message);
|
||||
sleep(1);
|
||||
this.writer.Close();
|
||||
isWritten = true;
|
||||
|
@ -59,6 +63,10 @@ function PipeIPC() {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
this._read = function() {
|
||||
return this.reader.ReadAll();
|
||||
};
|
||||
|
||||
this.read = function() {
|
||||
var isRead = false;
|
||||
|
@ -66,7 +74,7 @@ function PipeIPC() {
|
|||
|
||||
while (!isRead) {
|
||||
try {
|
||||
text = this.reader.ReadAll();
|
||||
text = this._read();
|
||||
isRead = true;
|
||||
} catch (e) {
|
||||
this.closeReader();
|
||||
|
|
Loading…
Reference in New Issue
Block a user