Orphans-Paradise / p2p-chat-specification

about design docs
0 stars 0 forks source link

PROTOCOL:extended slicing protocol #12

Open Kizna1ver opened 4 years ago

Kizna1ver commented 4 years ago

why design

Today I had a problem trying to send the base64 encoding of the image.When I tried to send a large image at once, the send failed. I tested that I could send a maximum of 1800 to 1900 characters at one time.So We're going to design a protocol for sharding to solve this problem.

Method

Change the message format to add fields to distinguish each piece of message. For example: { msgName:that.username, msgData:imgTag, msgId:
msgLength: imgSeq: } And I'm still thinking about it

zhaxzhax commented 4 years ago

You have missing msgType. Besides, could try use a object

imgMsg{msgid:string,msg: array}
//the array msg have all the message received in the same msgId.
//when msg.length=msg[0].msgLength,
//we could merge all the msg in imgMsg together to make a picture.
Kizna1ver commented 4 years ago

You have missing msgType. Besides, could try use a object

imgMsg{msgid:string,msg: array}
//the array msg have all the message received in the same msgId.
//when msg.length=msg[0].msgLength,
//we could merge all the msg in imgMsg together to make a picture.

You're exactly right.

zhaxzhax commented 4 years ago

@buttering Maybe your voice transmission will use this slicing protocol also. #6