Open longjiangyuan opened 8 years ago
var placeholder = [5]byte{} func (n Notification) ToBinary() ([]byte, error) { .... /* write header place holder*/ buf.Write(placeholder[:]) /* write fields: token,payload... etc */ ... /* rewrite header */ b = buf.Bytes() b[0] = commandID binary.BigEndian.PutUint32(b[1:5], uint32(len(b)-5)) return b, nil }
If you want to do a pull request I can merge it, but I'm no longer helping with the maintenance of this project. There is a new HTTP/2 Notification API and a library I'm writing for that.
https://github.com/RobotsAndPencils/buford