sebastian-j-ibanez / fsync

fsync is a CLI tool to sync folders P2P.
MIT License
0 stars 0 forks source link

Refactor Packet #1

Closed sebastian-j-ibanez closed 2 months ago

sebastian-j-ibanez commented 2 months ago

The current protocol splits a buffer into many different packets, which are then encoded by the gob library.

The problem is that gob already does this. We can send an entire buffer at once and packetization will be handled by gob.

The packet struct can be simplified. All it needs is:

sebastian-j-ibanez commented 2 months ago

This is actually a really short sighted idea. An ENTIRE file would be stored in memory at once.

This will not work with large files that are 1GB+. The best solution is to split up a file into smaller packets.