last day (14 days later) » 

9:26 AM
Hi . thank you for the detailed answer.
Can I ask related question ?
?
@AdrianoRepetti ?
 
hi
yes, of course
 
:-)
If I send a file like ( network stream) - via the first approach :
how does the other side know that I finished sending ?
must he know the file size ?
(the files size is known to the sender)
Are you busy ?
 
9:49 AM
just little bit, may be slow to answer
 
Ok did you see my Question ^ ?
 
well at least 3 options:
- you first send file size;
- you close connection;
- you send a file terminator (like EOF). it may not be applicable for binary files.
 
( yes I do send RAR files)
Ok so I did good
( i send the file size)
 
if you send an "header" (for example with file name) to the client then I'd go with option 1
at least you can also "resume" a broken download
 
I send 1 byte which its 4 left section : 0001-0000 ( here 16) - represents that it's a file
and then in the right 4 bites , I tell him : the size is represented in the next X bits
so 0001-0010 , tells reciever : it's a file (left 0001) , and please read the file size in the next 2 bytes (0010 - right side)
it's ok right ?
 
10:07 AM
yes, it looks somehow complicate but well it's a custom protocol so why not
 

last day (14 days later) »