Well, sure there is a queue where sockets wait for being accepted but when we do not execute accept the system will not accept it for us. The other thing is that we will not be able to send data to connections that were not accepted.
From the accept(2)
The accept() system call is used with connection-based socket types
(SOCK_STREAM, SOCK_SEQPACKET). It extracts the first connection
request on the queue of pending connections for the listening socket,
sockfd, creates a new connected socket, and returns a new file
descriptor referring to that socket.
Write the code that I posted in C and you will see the difference.
It looks like something in Golang is accepting new connections (netpoller ?) even that we do not Accept them.
I was surprised looking at this, normally when you do not accept connection it will be not accepted .
It seems that in golang everything will be accepted and it will accept an unlimited amount of data send to the socket without our knowledge/permission.
If this is the way golang wants it to be then fine, I was just surprised and did not find anything about this in the documentation.