![]() |
|
#1
|
|||
|
|||
C: Winsock's 'send()' not blockingI am currently trying to write a programin C on Windows 2000 that will send a file between two computers. The code I have right now seems to work, but there is a substanial problem with it. When sending the binary data from the server to the client, sometimes packets will mesh together. This will cause data to be lost because I have predetermined a size for each chunk of the file. Once the data arrives, I have the client only get the normal packet size. To help explain this, here is an example of the server:
CPP / C++ / C Code:
CPP / C++ / C Code:
First Packet: "this is an" 10 bytes Second Packet: " example o" 10 bytes Third Packet: "f the problem. blah." 20 bytes Normally, this will occur right around the 8 KB mark for some reason. If anyone could expain to me how to fix this problem, it would be greatly appreciated. |
|
#2
|
|||
|
|||
|
Assuming you are using TCP to transfer files between client and server, I would suggest following. This is not tested.
Server side CPP / C++ / C Code:
Client Side: CPP / C++ / C Code:
|
Recent GIDBlog
Meeting the local Iraqis by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Do you want to send this error to Microsoft? | priyanka | Open Discussion Forum | 11 | 29-Oct-2004 15:58 |
| Receive from HTML Form, add some then send it to other server | imlek | MySQL / PHP Forum | 0 | 21-Aug-2004 22:33 |
| send pc image to tv screen?! | Hood | Computer Hardware Forum | 5 | 05-May-2004 11:51 |
| Blocking Spambots by .htaccess | BobbyDouglas | Apache Web Server Forum | 2 | 16-Jan-2004 10:32 |
| send email via local intranet | skyloon | MySQL / PHP Forum | 1 | 30-Jun-2003 07:15 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The