I'm writting a client server application in which the client can send files to the server (.jpg files included). the application is connection oriented..
suppose I want to send an image file..
how can I do that? do I have to read the image file, store it in an array of char and then use the send() function to send it to the server?
Well there's no need to store the whole file in memory prior to sending it.
You could just read the file one buffer at a time, and send that to the server.
Start by sending the length of the file to the server, then all the bytes of the file.