JDWP uses the following structs for all communication: struct cmdPacket { length uint32 4 bytes id packetID 4 bytes flags packetFlags 1 bytes cmdSet cmdSet 1 bytes cmd uint8 1 bytes data []byte N bytes } struct reply { length uint32 4 bytes id pack
(w binary.Writer)
| 54 | // } |
| 55 | |
| 56 | func (p cmdPacket) write(w binary.Writer) error { |
| 57 | w.Uint32(11 + uint32(len(p.data))) |
| 58 | w.Uint32(uint32(p.id)) |
| 59 | w.Uint8(uint8(p.flags)) |
| 60 | w.Uint8(uint8(p.cmdSet)) |
| 61 | w.Uint8(uint8(p.cmdID)) |
| 62 | w.Data(p.data) |
| 63 | return w.Error() |
| 64 | } |
| 65 | |
| 66 | type replyPacket struct { |
| 67 | id packetID |