Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Fadecandy
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
scanlime
Fadecandy
Commits
a1076371
Commit
a1076371
authored
9 years ago
by
Micah Elizabeth Scott
Browse files
Options
Downloads
Plain Diff
Merge pull request #56 from pollonamid/master
add connection error handling and reconnect
parents
3ba592db
20eda7b9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/node/opc.js
+7
-0
7 additions, 0 deletions
examples/node/opc.js
with
7 additions
and
0 deletions
examples/node/opc.js
+
7
−
0
View file @
a1076371
...
...
@@ -33,6 +33,13 @@ OPC.prototype._reconnect = function()
_this
.
connected
=
false
;
}
this
.
socket
.
on
(
'
error
'
,
function
(
e
){
if
(
e
.
code
==
'
ECONNREFUSED
'
||
e
.
code
==
'
ECONNRESET
'
)
{
_this
.
socket
=
null
;
_this
.
connected
=
false
;
}
});
this
.
socket
.
connect
(
this
.
port
,
this
.
host
,
function
()
{
console
.
log
(
"
Connected to
"
+
_this
.
socket
.
remoteAddress
);
_this
.
connected
=
true
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment