Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo 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
Ejemplo n.º 6
0
 def from_binary(data):
     obj = SymmetricAlgorithmHeader()
     obj.TokenId = uatype_UInt32.unpack(data.read(4))[0]
     return obj
Ejemplo 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
Ejemplo n.º 8
0
 def from_binary(data):
     obj = SymmetricAlgorithmHeader()
     obj.TokenId = uatype_UInt32.unpack(data.read(4))[0]
     return obj