![]() |
| | #1 |
| Eager young mind Join Date: Jun 2006
Posts: 342
| data curroption The other requirement of the program is to read a file that exists in hte remote machine.. I have used the same concept even for that code and i have traced it many times to find any pit-falls, but I am not able to transfer files greater than 5000 bytes without the data being curropted.. I also noted these things.. 1 . the data in the packets that is being sent from hte remote machine is valid, thats not the case after I receive them here for the final few packets 2. also, the numbers returned by send() and recv() match for a large number of packets sent , the mismatch occurs in the last few packets.. By curropted ,I mean some sections of the file getting repeated right at the end , or after the actual file has been transfered, a part of the file also gets added. The lan is a standard one, I can do my usual ftp and telnet stuff. I cud have posted the code , but its quite bulky.. Has anyone faced this problem before, please help |
| kris.c is offline | |
| | #2 |
| Eager young mind Join Date: Jun 2006
Posts: 342
| i would like to add one more thing here : I was instructed break up large files into chunks of 1000 bytes and then use the send() iteratively .. only in the in the last packet, the send() and recv() functions return different values.. |
| kris.c is offline | |
| | #3 |
| and the hat of Jobseeking Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,650
| Deja-vu again and again? send() and recv() functions file transfer across network 1. Are you using a TCP or UDP connection? 2. Do you send the length of the file first, then the contents of the file? |
| Salem is offline | |
| | #4 |
| Eager young mind Join Date: Jun 2006
Posts: 342
| forget about that ,i cud fix it.. |
| kris.c is offline | |
| | #5 | |
| Carnivore ('-'v) Join Date: May 2002
Posts: 2,866
| Quote:
*EDIT: Actually, the second case would lead to random unpredictable bits of data strewn all throughout your output, and a predictable segment of the second-last packet being appended to the last. Judging from the previous threads, this is *probably* the problem. *EDIT2: Actually, the 'predictable' segment will *not* occur if: (filesize % buffersize) == (unpredictable_bytes % buffersize). See if you can figure out why.
__________________ Just Google It. √ (\ /) ( . .) c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination. Last edited by Hunter2; 06-30-2006 at 07:13 AM. | |
| Hunter2 is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| xor linked list | adramalech | C Programming | 23 | 10-14-2008 10:13 AM |
| brace-enclosed error | jdc18 | C++ Programming | 53 | 05-03-2007 05:49 PM |
| singly linked circular list | DarkDot | C++ Programming | 0 | 04-24-2007 08:55 PM |
| Program Crashing | Pressure | C Programming | 3 | 04-18-2005 10:28 PM |
| Ask about how to use startdoc(), startpage() to print data on paper imediately. | ooosawaddee3 | C++ Programming | 1 | 07-31-2002 11:35 AM |