Developing lightweight computation at the DSG edge

Commit 2712f4c1 authored by Mathias Weber's avatar Mathias Weber
Browse files

fixed encoding of messages

parent f541b87c
......@@ -76,8 +76,10 @@ func (client *Client) StartTransaction() (tx *InteractiveTransaction, err error)
if err != nil {
return
}
readwrite := uint32(0)
blue := uint32(0)
apbtxn := &ApbStartTransaction{
Properties: &ApbTxnProperties{},
Properties: &ApbTxnProperties{ReadWrite: &readwrite, RedBlue: &blue},
}
err = apbtxn.encode(con)
if err != nil {
......
......@@ -69,7 +69,7 @@ func encodeMsg(message proto.Message, msgCode byte, writer io.Writer) (err error
}
msgsize := len(msg)
buf := make([]byte, 5)
binary.BigEndian.PutUint32(buf[0:4], uint32(msgsize))
binary.BigEndian.PutUint32(buf[0:4], uint32(msgsize+1))
buf[4] = msgCode
writer.Write(buf)
writer.Write(msg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment