DalexL
Active member
- Joined
- Jul 3, 2010
- Messages
- 34
- Programming Experience
- 3-5
Basing my work off of an online example, I haven't even thought about the buffer size they chose "10024" but I think it is causing problems. Sending messages and responses has worked fine for strings such as "request:connect" and "client:request_download". I tried sending a file over (a large .zip that my server auto-generates).
Now this is where it gets messy. The .zip works fine before being transfered (Its saved in a sub directory of the servers resources) but after doing a client request, the file the client saves to my desktop (which will later be put in tmp and then extracted for install) is incomplete, therefor corrupt. I've looked at it with multiple editors and have determined that about 1/3 of it is fine and 2/3 corrupt. I assume this is because of some sort of response issue (not replying with the whole message). Its not sending over a stream so it shouldn't have any issues because I'm just sending the bytes over.
My assumption:
Because the bytes are set to a max of '10024', the file is not fully sent. I can easily figure out the size of the file but here is my actual question:
What is the standard why of telling the client the needed byte buffer size for the next message and vice versa?
Now this is where it gets messy. The .zip works fine before being transfered (Its saved in a sub directory of the servers resources) but after doing a client request, the file the client saves to my desktop (which will later be put in tmp and then extracted for install) is incomplete, therefor corrupt. I've looked at it with multiple editors and have determined that about 1/3 of it is fine and 2/3 corrupt. I assume this is because of some sort of response issue (not replying with the whole message). Its not sending over a stream so it shouldn't have any issues because I'm just sending the bytes over.
My assumption:
Because the bytes are set to a max of '10024', the file is not fully sent. I can easily figure out the size of the file but here is my actual question:
What is the standard why of telling the client the needed byte buffer size for the next message and vice versa?