eTh3r-network / vapor

eTher server written in go
MIT License
3 stars 0 forks source link

Should the server directly send the room id when client 2 accept a knock ? #8

Closed Portevent closed 1 month ago

Portevent commented 8 months ago

When client 2 accept the knock, client 1 recieve both a confirmation packet and a room id packet.

https://github.com/eTh3r-network/vapor/blob/1b91769cbcf09f1ae06f69cde860709c98d4bd51/PROTOCOL.md?plain=1#L39 https://github.com/eTh3r-network/vapor/blob/1b91769cbcf09f1ae06f69cde860709c98d4bd51/PROTOCOL.md?plain=1#L42

But we can assume that recieving a room id implies that c2 accepted the knock, thus making the confirmation request redudent when c2 accept. One request can be saved if we only forward c2 response when c2 refuses the knock.

aaryswastaken commented 8 months ago

I think that having two packets is useful but not mandatory. The ack pkg is mainly here to ack that c1 has been added to the room. Even if a third client, c3, has access to the room id, it won't be able to use it because it is not referenced in the server. Tho this will really be useful once chat rooms will be implemented

aaryswastaken commented 1 month ago

Closing, feel free to open it back again