Hands-On-Network-Programming-with-C
                                
                                 Hands-On-Network-Programming-with-C copied to clipboard
                                
                                    Hands-On-Network-Programming-with-C copied to clipboard
                            
                            
                            
                        Chapter 2: time_server.c
Hi codeplea,
I realized the following behavior: The server closes after connection of the client browser. Closing the browser on the local maschine leads to the strange state, that the server cannot bind to the 8080 port. This I observed on my local Debian machines. Is there maybe something not released in the example code. After some time the binding is again possible. I think this is reasoned by TIME_WAIT for old packages. But it needs really minutes that the 8080 port is available again. Is there a way to programmatically avoid this wait cycle. Maybe to early asked -- started the book reading some minutes ago.
Thanks for info, Stephan
Hi Stephan,
Have you read the sections in the book called "Connection tear-down", "The shutdown() function", and "Preventing address-in-use errors" starting on page 378 and? It sounds like a TIME-WAIT issue. You can diagnose with netstat -na. If that is indeed the issue, then the simple fix is to use the SO_REUSEADDR flag.
Thanks so much, dear mate ... I am a total rookie in these regards. Have a good day ! Cheers, Stephan
-- Stephan Strauss @.***>
On Mon, 2022-08-29 at 17:19 -0700, Lewis Van Winkle wrote:
Hi Stephan,
Have you read the sections in the book called "Connection tear-down", "The shutdown() function", and "Preventing address-in-use errors" starting on page 378 and? It sounds like a TIME-WAIT issue. You can diagnose with netstat -na. If that is indeed the issue, then the simple fix is to use the SO_REUSEADDR flag.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>