I'm not very professional in socket programming. I open a socket to the client and when connection succeed, I try to send a file. I read the file from the disk buffer by buffer and write this bytes on the NetworkStream object. Client receives this information from NetworkStream and writes them in a file on its own disk.
File transfers successfully, but during the sending operation, my CPU usage increases a lot and it takes a long time to do this operation. For example it takes about 4-5 minutes to send 1 MB file to client. But it not seems to be correct, because all of socket programs that I have seen are not as slow as my program.
What's the problem?
Thanks and sorry for my bad English!