Processing data from a TCP socket - Programming On Unix

Users browsing this thread: 4 Guest(s)
venam
Administrators
It seems your issue is with the arbitrary sizes.
So maybe you could divide it into:
Code:
* filename length
* filename
* sha512 digest for this file (128 bytes)
* mtime number of bytes
* mtime for this file (arbitrary size, up to 19 bytes)

That would optimize it for big values but has an overhead for small values.
However, with that approach you don't have to set a static size for the whole struct.


Messages In This Thread
Processing data from a TCP socket - by z3bra - 22-08-2016, 07:12 PM
RE: Processing data from a TCP socket - by venam - 23-08-2016, 12:34 AM
RE: Processing data from a TCP socket - by z3bra - 23-08-2016, 04:21 AM
RE: Processing data from a TCP socket - by venam - 23-08-2016, 04:30 AM
RE: Processing data from a TCP socket - by z3bra - 23-08-2016, 04:53 AM
RE: Processing data from a TCP socket - by venam - 23-08-2016, 05:58 AM
RE: Processing data from a TCP socket - by z3bra - 23-08-2016, 08:51 AM
RE: Processing data from a TCP socket - by z3bra - 23-08-2016, 01:50 PM
RE: Processing data from a TCP socket - by z3bra - 23-08-2016, 07:22 PM
RE: Processing data from a TCP socket - by z3bra - 24-08-2016, 04:11 AM
RE: Processing data from a TCP socket - by apk - 24-08-2016, 11:33 AM