Thanks for the example. I remember sometimes the port is occupied for a longer time, I’ve seen this a couple of times even if no process actually uses it. There is just some delay until it’s freed by the os. So in that case it still would not help, Right?
I haven't used this hand made server very much, but what you are saying about the delay in closing the socket sounds like it could happen.
There may be a blocking command that I am unfamiliar with to check whether the port is free. Otherwise I would think of putting a sleep command in there to give the os time to free it.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.