- In the extension bar, click the AdBlock Plus icon
- Click the large blue toggle for this website
- Click refresh
- In the extension bar, click the AdBlock icon
- Under "Pause on this site" click "Always"
- In the extension bar, click on the Adguard icon
- Click on the large green toggle for this website
- In the extension bar, click on the Ad Remover icon
- Click "Disable on This Website"
- In the extension bar, click on the orange lion icon
- Click the toggle on the top right, shifting from "Up" to "Down"
- In the extension bar, click on the Ghostery icon
- Click the "Anti-Tracking" shield so it says "Off"
- Click the "Ad-Blocking" stop sign so it says "Off"
- Refresh the page
- In the extension bar, click on the uBlock Origin icon
- Click on the big, blue power button
- Refresh the page
- In the extension bar, click on the uBlock icon
- Click on the big, blue power button
- Refresh the page
- In the extension bar, click on the UltraBlock icon
- Check the "Disable UltraBlock" checkbox
- Please disable your Ad Blocker
- Disable any DNS blocking tools such as AdGuardDNS or NextDNS
- Disable any privacy or tracking protection extensions such as Firefox Enhanced Tracking Protection or DuckDuckGo Privacy.
If the prompt is still appearing, please disable any tools or services you are using that block internet ads (e.g. DNS Servers, tracking protection or privacy extensions).
Question
anog
Hi guys!
I really need your help on this one... i can't figure it out, and since I'm new to socket programming... :(
I have to create a small webserver for a class I'm taking. So far so good - the webserver is working properly and delivering files to the clients. With only one problem...
If the client closes the connect while the server is sending the files, the server just stops executing. No error message is displayed, no segmentation fault, nothing... It just goes back to the command prompt when it should listen for other connections.
If the client never stops the connection while it is receiving the files, everything works fine.
Examples of it closing the connection would be pressing CTRL-C while wget is receiving a file, or hitting Refresh on the browser while it is loading a page/image.
My guess (and I dunno if it is an accurate one...) is that before sending anything to the client it must see if the socket is open.
But this wouldn't be 100% secure - what if the client closes the connection after the server sees if the connection is open, but before it actually sends anything through it?
The method I'm using to send stuff to the client is opening a socket and a file descriptor of that socket. I then send stuff using fputc and checking for EOF as a return value (to see if something went wrong).
It may not be the best method, but it was just to get started - I haven't optimized anything yet.
So.. any ideas or suggestions?...
Thanks!
Link to comment
https://www.neowin.net/forum/topic/397530-help-with-socket-programming-in-c-linux/Share on other sites
3 answers to this question
Recommended Posts