Like Gambit already said, there is little reason to do this in practice, especially if like in your example, those 2 statements are really executed one after the other.
The first statement will block until an incoming connection arrives and accept it into the socket object.
The second statement will block until an incoming arrives, disconnect the connection currently in the socket object, and populate it with the new connection.
What you essentially end up doing is prevent multiple connections from ever being processed simultaneously. As soon as another connection request arrives, the previous one will be disconnected. This is all disregarding the fact that if you are running this in a single thread, it would block your whole application until the second connection attempt is made anyway.
Just don't do this, it is not only bad practice, but it really has no purpose and might not even do what you expected.