I am writing a socket programming in C to transfer files from Server to Client. where client sends a filename to server and the server reply with the file content. I couldn't understand how a server can intimate the client when the file asked by the client is not found in server side. Do i have to use any standard to reply a package to client, where the client can understand that as a FileNotFound ?
Asked
Active
Viewed 33 times
-1
-
1Maybe you should read up about the concept of [Communication protocol](https://en.wikipedia.org/wiki/Communication_protocol), e.g. messages, handshake, etc. – Stefan Becker Jan 29 '19 at 07:18
1 Answers
0
In your communication model, you are missing a layer of meta-data or control messages. at the minimum, you need to pass a status code before you return the file. I suggest that you implement a simplified version of HTTP client. you can find an example at:

eyalm
- 3,366
- 19
- 21
-
thank you for the suggestion, I added a layer for meta-data and it worked fine. – Mouriyan Rajendran Jan 31 '19 at 06:17