Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nginx-push-stream-module
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
nginx-push-stream-module
Commits
a690c2e0
Commit
a690c2e0
authored
Feb 21, 2012
by
Wandenberg Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using native reconection feature from EventSource javascript class
parent
7982a799
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
pushstream.js
misc/js/pushstream.js
+13
-2
No files found.
misc/js/pushstream.js
View file @
a690c2e0
...
@@ -292,6 +292,13 @@
...
@@ -292,6 +292,13 @@
var
onerrorCallback
=
function
(
event
)
{
var
onerrorCallback
=
function
(
event
)
{
Log4js
.
info
(
"
[
"
+
this
.
type
+
"
] error (disconnected by server):
"
,
event
);
Log4js
.
info
(
"
[
"
+
this
.
type
+
"
] error (disconnected by server):
"
,
event
);
if
((
this
.
pushstream
.
readyState
===
PushStream
.
OPEN
)
&&
(
this
.
type
===
EventSourceWrapper
.
TYPE
)
&&
(
event
.
type
===
'
error
'
)
&&
(
this
.
connection
.
readyState
===
EventSource
.
CONNECTING
))
{
// EventSource already has a reconection function using the last-event-id header
return
;
}
this
.
_closeCurrentConnection
();
this
.
_closeCurrentConnection
();
this
.
pushstream
.
_onerror
({
type
:
((
event
&&
(
event
.
type
===
"
load
"
))
||
(
this
.
pushstream
.
readyState
===
PushStream
.
CONNECTING
))
?
"
load
"
:
"
timeout
"
});
this
.
pushstream
.
_onerror
({
type
:
((
event
&&
(
event
.
type
===
"
load
"
))
||
(
this
.
pushstream
.
readyState
===
PushStream
.
CONNECTING
))
?
"
load
"
:
"
timeout
"
});
}
}
...
@@ -754,7 +761,9 @@
...
@@ -754,7 +761,9 @@
this
.
wrapper
.
connect
();
this
.
wrapper
.
connect
();
}
catch
(
e
)
{
}
catch
(
e
)
{
//each wrapper has a cleanup routine at disconnect method
//each wrapper has a cleanup routine at disconnect method
this
.
wrapper
.
disconnect
();
if
(
this
.
wrapper
)
{
this
.
wrapper
.
disconnect
();
}
}
}
},
},
...
@@ -768,7 +777,9 @@
...
@@ -768,7 +777,9 @@
_onopen
:
function
()
{
_onopen
:
function
()
{
this
.
reconnecttimer
=
clearTimer
(
this
.
reconnecttimer
);
this
.
reconnecttimer
=
clearTimer
(
this
.
reconnecttimer
);
this
.
_setState
(
PushStream
.
OPEN
);
this
.
_setState
(
PushStream
.
OPEN
);
this
.
_lastUsedMode
--
;
//use same mode on next connection
if
(
this
.
_lastUsedMode
>
0
)
{
this
.
_lastUsedMode
--
;
//use same mode on next connection
}
},
},
_onclose
:
function
()
{
_onclose
:
function
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment