update pilz lib
This commit is contained in:
@@ -6,6 +6,7 @@ Public MustInherit Class ConnectionManagerBase
|
||||
Private listening As Boolean = False
|
||||
|
||||
Public ReadOnly Property Port As Integer
|
||||
Public Property UseAssemblyQualifiedName As Boolean = False
|
||||
|
||||
Public Event RetriveData(manager As ConnectionManagerBase, senderIP As String, cmd As String, content As Object)
|
||||
|
||||
@@ -42,14 +43,14 @@ Public MustInherit Class ConnectionManagerBase
|
||||
RaiseEvent RetriveData(Me, senderIP, cmd, content)
|
||||
End Sub
|
||||
|
||||
Protected Shared Function EncodeToBytes(cmd As String, content As Object) As Byte()
|
||||
Protected Shared Function EncodeToBytes(cmd As String, content As Object, useAssemblyQualifiedName As Boolean) As Byte()
|
||||
Dim ms As New MemoryStream()
|
||||
Dim bw As New BinaryWriter(ms)
|
||||
Dim obj As New JObject
|
||||
|
||||
'Write header
|
||||
obj("Cmd") = cmd
|
||||
obj("ContentType") = content?.GetType?.ToString
|
||||
obj("ContentType") = If(useAssemblyQualifiedName, content?.GetType?.AssemblyQualifiedName, content?.GetType?.ToString)
|
||||
|
||||
'Content
|
||||
obj("Content") = JToken.FromObject(content)
|
||||
|
||||
Reference in New Issue
Block a user