i have a socket server that written by java(using netty),i use LengthFieldBasedFrameDecoder to decode message ; the encoder ,if use java should be:
Message.Type msgType = in.type();
// All messages have the frame length, message type, and message itself.
int headerLength = 8 + msgType.encodedLength() + in.encodedLength();
// long frameLength = headerLength + bodyLength;
ByteBuf header = ctx.alloc().heapBuffer(headerLength);
//header.writeLong(frameLength);
header.writeLong(headerLength);
msgType.encode(header);
in.encode(header);
but now i need a socket client written by python ,so how do i write the message length(8 bytes,long type) into buffer