Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
opcua-asyncio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
opcua-asyncio
Commits
364b9fc6
Commit
364b9fc6
authored
Oct 23, 2015
by
Alexander Korolkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some typos in messages
parent
ff14843a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
opcua/binary_client.py
opcua/binary_client.py
+2
-2
opcua/binary_server_asyncio.py
opcua/binary_server_asyncio.py
+1
-1
opcua/uaprocessor.py
opcua/uaprocessor.py
+1
-1
opcua/uatypes.py
opcua/uatypes.py
+1
-1
opcua/utils.py
opcua/utils.py
+2
-2
No files found.
opcua/binary_client.py
View file @
364b9fc6
...
@@ -85,7 +85,7 @@ class UASocketClient(object):
...
@@ -85,7 +85,7 @@ class UASocketClient(object):
self
.
logger
.
debug
(
"reading body of message (%s bytes)"
,
size
)
self
.
logger
.
debug
(
"reading body of message (%s bytes)"
,
size
)
data
=
self
.
_socket
.
read
(
size
)
data
=
self
.
_socket
.
read
(
size
)
if
size
!=
len
(
data
):
if
size
!=
len
(
data
):
raise
Exception
(
"Error, did not receive
d
expected number of bytes, got {}, asked for {}"
.
format
(
len
(
data
),
size
))
raise
Exception
(
"Error, did not receive expected number of bytes, got {}, asked for {}"
.
format
(
len
(
data
),
size
))
return
utils
.
Buffer
(
data
)
return
utils
.
Buffer
(
data
)
def
_receive
(
self
):
def
_receive
(
self
):
...
@@ -99,7 +99,7 @@ class UASocketClient(object):
...
@@ -99,7 +99,7 @@ class UASocketClient(object):
body
.
data
=
body_chunk
+
body
.
data
body
.
data
=
body_chunk
+
body
.
data
break
break
elif
hdr
.
ChunkType
==
b"C"
:
elif
hdr
.
ChunkType
==
b"C"
:
self
.
logger
.
debug
(
"Received a
a
n intermediate message with header %s, waiting for next message"
,
hdr
)
self
.
logger
.
debug
(
"Received an intermediate message with header %s, waiting for next message"
,
hdr
)
body_chunk
+=
body
.
data
body_chunk
+=
body
.
data
else
:
else
:
self
.
logger
.
warning
(
"Received a message with unknown ChunkType %s, in header %s"
,
hdr
.
ChunkType
,
hdr
)
self
.
logger
.
warning
(
"Received a message with unknown ChunkType %s, in header %s"
,
hdr
.
ChunkType
,
hdr
)
...
...
opcua/binary_server_asyncio.py
View file @
364b9fc6
...
@@ -87,7 +87,7 @@ class BinaryServer(object):
...
@@ -87,7 +87,7 @@ class BinaryServer(object):
coro
=
self
.
loop
.
create_server
(
OPCUAProtocol
,
self
.
hostname
,
self
.
port
)
coro
=
self
.
loop
.
create_server
(
OPCUAProtocol
,
self
.
hostname
,
self
.
port
)
self
.
_server
=
self
.
loop
.
run_coro_and_wait
(
coro
)
self
.
_server
=
self
.
loop
.
run_coro_and_wait
(
coro
)
print
(
'Listening on
%s:%s'
,
self
.
_server
.
sockets
[
0
].
getsockname
(),
self
.
port
)
print
(
'Listening on
{}:{}'
.
format
(
self
.
hostname
,
self
.
port
)
)
def
stop
(
self
):
def
stop
(
self
):
print
(
"Closing asyncio socket server"
)
print
(
"Closing asyncio socket server"
)
...
...
opcua/uaprocessor.py
View file @
364b9fc6
...
@@ -368,6 +368,6 @@ class UAProcessor(object):
...
@@ -368,6 +368,6 @@ class UAProcessor(object):
to be called when client has disconnected to ensure we really close
to be called when client has disconnected to ensure we really close
everything we should
everything we should
"""
"""
print
(
"Cleanup
up
client connection: "
,
self
.
name
)
print
(
"Cleanup client connection: "
,
self
.
name
)
if
self
.
session
:
if
self
.
session
:
self
.
session
.
close_session
(
True
)
self
.
session
.
close_session
(
True
)
opcua/uatypes.py
View file @
364b9fc6
...
@@ -869,7 +869,7 @@ class DataValue(FrozenClass):
...
@@ -869,7 +869,7 @@ class DataValue(FrozenClass):
return
obj
return
obj
def
__str__
(
self
):
def
__str__
(
self
):
s
=
'DataValue(Value:{}
)
'
.
format
(
self
.
Value
)
s
=
'DataValue(Value:{}'
.
format
(
self
.
Value
)
if
self
.
StatusCode
is
not
None
:
if
self
.
StatusCode
is
not
None
:
s
+=
', StatusCode:{}'
.
format
(
self
.
StatusCode
)
s
+=
', StatusCode:{}'
.
format
(
self
.
StatusCode
)
if
self
.
SourceTimestamp
is
not
None
:
if
self
.
SourceTimestamp
is
not
None
:
...
...
opcua/utils.py
View file @
364b9fc6
...
@@ -36,7 +36,7 @@ class Buffer(object):
...
@@ -36,7 +36,7 @@ class Buffer(object):
read and pop number of bytes for buffer
read and pop number of bytes for buffer
"""
"""
if
size
>
len
(
self
.
data
):
if
size
>
len
(
self
.
data
):
raise
Exception
(
"No enough data left in buffer, request for {}, we have {}"
.
format
(
size
,
self
))
raise
Exception
(
"No
t
enough data left in buffer, request for {}, we have {}"
.
format
(
size
,
self
))
#self.logger.debug("Request for %s bytes, from %s", size, self)
#self.logger.debug("Request for %s bytes, from %s", size, self)
data
=
self
.
data
[:
size
]
data
=
self
.
data
[:
size
]
self
.
data
=
self
.
data
[
size
:]
self
.
data
=
self
.
data
[
size
:]
...
@@ -57,7 +57,7 @@ class Buffer(object):
...
@@ -57,7 +57,7 @@ class Buffer(object):
read 'size' bytes from buffer, without removing them from buffer
read 'size' bytes from buffer, without removing them from buffer
"""
"""
if
size
>
len
(
self
.
data
):
if
size
>
len
(
self
.
data
):
raise
Exception
(
"No enough data left in buffer, request for {}, we have {}"
.
format
(
size
,
self
))
raise
Exception
(
"No
t
enough data left in buffer, request for {}, we have {}"
.
format
(
size
,
self
))
return
self
.
data
[:
size
]
return
self
.
data
[:
size
]
class
SocketClosedException
(
Exception
):
class
SocketClosedException
(
Exception
):
...
...
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