hi i am just wondering how would you send a website through a socket as i am trying to make my own web server.

do you just open up the file, read the file and write out to the socket ?

openfile = open(home/username/www/index.html, "r"); 

n = read(openfile,buffer,256); 

n = write(newsock_filedesc,openfile, 256) ;

Line 6 is wrong, it should be

n = write(newsock_filedesc,buffer, 256) ;

so you do not need to read in the html file ?

Line 4 reads the file contents into a buffer and then line 6 writes that buffer into a socket.