i am trying to write a simple webserver which serves 1 htnl file but i dont know where i am going wrong i am not able to read the file any suggestions ?
listen(sockfd,5);
clilen = sizeof(cli_addr);
newsockfd = accept(sockfd,(struct sockaddr *) &cli_addr, &clilen);
if(newsockfd < 0) error("eror on accept");
bzero(buffer,256);
FILE* open;
open =fopen("/home/rocco/www/home.hml","r");
n = recv(newsockfd,open,255,0);
if(n< 0) error("error reading from socket");
printf("here is the message: %s\n", buffer);
n = send(newsockfd,open, 18,0);
if(n<0) error("writing to socket");
close(newsockfd);
close(sockfd);
return 0;