|
-
Dec 26th, 2009, 04:03 AM
#1
Thread Starter
New Member
Winsock File Transfer Help Needed
Hello - I'm using the Mabry socket controls and I'm trying to transfer a file. I've written the client server programs and everything works but there seems to be one problem and I can't figure out what is wrong.
When the file is transferred it is corrupted. I have a test program that tries to send a 75 megabyte zip file. All of this is tested in my LAN environment (even running both programs client/server apps on my on my own computer). I have compared the files and noticed that what is happening is this: If I send chunks of data of say 1024 bytes then it successfully sends around 140K of data then 1024 bytes of data after that is nothing but zeros then data is good again for a random amount of bytes then another 1024 bytes of data is nothing but zeros.
I have checked the client side and it is not ever loading the socket buffer with anywhere near 1000 zeros anywhere in the file. But, it's like random places throughout the received file have zeros in them. I'm sending data and checking for errors and when I get an error I stop sending data and wait for the send event to fire so that the mabry socket is ready to accept more data. When the file transfer finishes the file size does match - it's just it has these zeroed out chunks of data of 1024 bytes (which is the size I'm sending in a loop).
Please help.
Thanks,
-
Dec 28th, 2009, 12:11 PM
#2
New Member
Re: Winsock File Transfer Help Needed
Hi
I had also troubles with sending large files but fixed it.
The thing is that the chunks are not always 1024 K and that the last chunk is filled with 0000
I do not know how you store the buffer on server. first into a array or directly in a file ?
Sacha
-
Jan 5th, 2010, 03:52 PM
#3
Hyperactive Member
-
Jan 5th, 2010, 06:14 PM
#4
Thread Starter
New Member
Re: Winsock File Transfer Help Needed
I'm beginning to wonder if the Winsock has bugs in it and that is what the problem is. My code looks sound and works as long as I don't try and pass too much information.
Mike
-
Jan 25th, 2010, 12:29 PM
#5
Lively Member
Re: Winsock File Transfer Help Needed
 Originally Posted by mike1960
Hello - I'm using the Mabry socket controls and I'm trying to transfer a file. I've written the client server programs and everything works but there seems to be one problem and I can't figure out what is wrong.
When the file is transferred it is corrupted. I have a test program that tries to send a 75 megabyte zip file. All of this is tested in my LAN environment (even running both programs client/server apps on my on my own computer). I have compared the files and noticed that what is happening is this: If I send chunks of data of say 1024 bytes then it successfully sends around 140K of data then 1024 bytes of data after that is nothing but zeros then data is good again for a random amount of bytes then another 1024 bytes of data is nothing but zeros.
I have checked the client side and it is not ever loading the socket buffer with anywhere near 1000 zeros anywhere in the file. But, it's like random places throughout the received file have zeros in them. I'm sending data and checking for errors and when I get an error I stop sending data and wait for the send event to fire so that the mabry socket is ready to accept more data. When the file transfer finishes the file size does match - it's just it has these zeroed out chunks of data of 1024 bytes (which is the size I'm sending in a loop).
Please help.
Thanks,
can u attach the source code so i can help u

Im Pro in C#,VB.NET,Batch,Socket Programming, SPY Software Programming, VB6, Win32Api, VBscript, Windows Registry, ASP.NET, PHP, Jquery, AJAX.
-
Jan 26th, 2010, 11:25 AM
#6
Re: Winsock File Transfer Help Needed
I doubt the underlying Winsock API is the problem. You'd have lots of other problems if this were true.
I just tested an old file transfer program of mine written in VB6 using the Winsock control. It transferred a 240MB DivX video just fine. The file plays fine with no glitches all the way through to the end.
-
Jan 26th, 2010, 11:53 AM
#7
Thread Starter
New Member
Re: Winsock File Transfer Help Needed
The problem seems to have something to do with the VFP 6/sp3 language I'm using because it does not have the problem in VFP 9. Perhaps a different third party control out there might work better if anyone knows.
Thanks,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|