PDA

Click to See Complete Forum and Search --> : Problem with my web server


TheDarkSide
Jun 29th, 2002, 01:30 PM
problem = i made a web server in C++ and it will send pictures or binary based files to the browser when requested by themselves, but when you request a page with a bunch of pictures either they dont all load, or none load at all. for example if you request /textfile.txt it will load. if you request /picture.gif it will load. but if you request /index.html with a bunch of pictures in it they wont all load. i think this is because the browser is requesting so many things from my server that it cant send them all or it closes the connection to early before the entire file is sent. any ideas?

Zaei
Jun 29th, 2002, 01:55 PM
Web browsers open a new connection for every image in a page. For instance, if you have a page with 4 images, the browser connects, and downloads the page requested, and then disconnects. It sees that there is an image, so it connects, downloads, and disconnects. It sees another pictures, connects, downloads, and disconnects. And so on. Are you resetting your server after each connection to allow another connection immediately?

Z.

TheDarkSide
Jun 29th, 2002, 02:05 PM
i know how web server/browsers work. i think i am. i have a array of sockets that accept each connection.

AlbafaN
Jun 29th, 2002, 04:29 PM
Ya, your probably not gonna wanna use the same socket for all the connections ;)