And why are you using UDP for file transfer? Are you willing to accept chunks going missing or arriving out of order? Or are you going to implement sequencing and retransmission--which TCP give you for free?
Joined: Apr 16, 2012
My problem is when the client read the file put in the package sent to the server, the server receives the packet and create the same file in client but nothing is written to the file.
I use UDP because it is my homework, I have the idea that every time the client transfer packet will numbered order packets if the packet is missing or arriving out of order, the client will send back
Seems like it's time to do some debugging. That starts with observing what your program is doing. Add print statements in your server so you can see which bytes you're receiving, how big the packets are, and how often the loop body is being executed. Likewise, add print statements to the client so that you can verify what it's sending.
subject: transfer files from client to server using the UDP protocol