Hello Khaled, thanks for your reply
I just did a test and i am able to listen around 5 seconds after i stop the listen.
If i netstat -a i can still see the time_wait so it seems there is some other reason for this error.
In the midle i get the errors tho the portfree says it is free.
In my opinion or portfree isn't working well or the socklisten isn't doing something that does after those 5 seconds.
Best regards
p.s I did another check and it seems to give the error only while a connection that started on that port is in FIN_WAIT_1 or ESTABLISHED, after this (TIME_WAIT included) the listen works well and the sockect works correctly receiving connections.