Esempio n. 1
0
 def from_binary(data):
     hello = Hello()
     hello.ProtocolVersion = uatype_UInt32.unpack(data.read(4))[0]
     hello.ReceiveBufferSize = uatype_UInt32.unpack(data.read(4))[0]
     hello.SendBufferSize = uatype_UInt32.unpack(data.read(4))[0]
     hello.MaxMessageSize = uatype_UInt32.unpack(data.read(4))[0]
     hello.MaxChunkCount = uatype_UInt32.unpack(data.read(4))[0]
     hello.EndpointUrl = uatypes.unpack_string(data)
     return hello
Esempio n. 2
0
 def from_binary(data):
     hello = Hello()
     hello.ProtocolVersion = uatype_UInt32.unpack(data.read(4))[0]
     hello.ReceiveBufferSize = uatype_UInt32.unpack(data.read(4))[0]
     hello.SendBufferSize = uatype_UInt32.unpack(data.read(4))[0]
     hello.MaxMessageSize = uatype_UInt32.unpack(data.read(4))[0]
     hello.MaxChunkCount = uatype_UInt32.unpack(data.read(4))[0]
     hello.EndpointUrl = uatypes.unpack_string(data)
     return hello
Esempio n. 3
0
 def from_string(data):
     hdr = Header()
     hdr.MessageType, hdr.ChunkType, hdr.packet_size = struct.unpack("<3scI", data.read(8))
     hdr.body_size = hdr.packet_size - 8
     if hdr.MessageType in (MessageType.SecureOpen, MessageType.SecureClose, MessageType.SecureMessage):
         hdr.body_size -= 4
         hdr.ChannelId = uatype_UInt32.unpack(data.read(4))[0]
     return hdr
Esempio n. 4
0
 def from_string(data):
     hdr = Header()
     hdr.MessageType, hdr.ChunkType, hdr.packet_size = struct.unpack(
         "<3scI", data.read(8))
     hdr.body_size = hdr.packet_size - 8
     if hdr.MessageType in (MessageType.SecureOpen, MessageType.SecureClose,
                            MessageType.SecureMessage):
         hdr.body_size -= 4
         hdr.ChannelId = uatype_UInt32.unpack(data.read(4))[0]
     return hdr
Esempio n. 5
0
 def from_binary(data):
     obj = SequenceHeader()
     obj.SequenceNumber = uatype_UInt32.unpack(data.read(4))[0]
     obj.RequestId = uatype_UInt32.unpack(data.read(4))[0]
     return obj
Esempio n. 6
0
 def from_binary(data):
     obj = SymmetricAlgorithmHeader()
     obj.TokenId = uatype_UInt32.unpack(data.read(4))[0]
     return obj
Esempio n. 7
0
 def from_binary(data):
     obj = SequenceHeader()
     obj.SequenceNumber = uatype_UInt32.unpack(data.read(4))[0]
     obj.RequestId = uatype_UInt32.unpack(data.read(4))[0]
     return obj
Esempio n. 8
0
 def from_binary(data):
     obj = SymmetricAlgorithmHeader()
     obj.TokenId = uatype_UInt32.unpack(data.read(4))[0]
     return obj