Perl IO::Socket server socket strange behaviour

I’m trying to create a server that listen on a port and that never answer nor accept anything.

Here my small code :

To test it, I run the server :

And then I try the socket timeout with for instance a redis connection with a timeout :

The first time I do this, the Redis stay lock forever ! I have try a IO::Socket client simple, it seems that the first time the IO::Socket listen on a port, it prepare an accept command, and lead to IO::Socket client think that the server has accepted the connexion.
But this is not true !

The second time I run the redis script I got :

And that is the correct message.

I have also try with the official client :

First time, I got the console :

And then it is lock forever at the second try :

I will try other client and may be create a server in another languages, but since IO::Socket has not been fixed since several years and several bugs has been reported, I think we have to live with that.


Short URL: