Sending file over socket
- by johannix
I'm have a problem sending data as a file from one end of a socket to the other. What's happening is that both the server and client are trying to read the file so the file never gets sent. I was wondering how to have the client block until the server's completed reading the file sent from the client.
I have this working with raw packets using send and recv, but figured this was a cleaner solution...
Client:
connects to server creating socket connection
creates a file on socket and sends data
waits for file from server
Server:
waits for file from client
Complete interraction:
client sends data to server
server sends data to client