If you want to accept multiple connections then you should have code kind of ...
while( true )
{
SOCKET soc = AcceptSocket ()
Create a thread and send the soc object to that thread.
}
Moral of the story is ,
Your server should accept the connection and should delegate the work associated with the connection to thread.
You main program should be free and wait for the connection.
In your case , you are calling AcceptSocket just once. This is why you are getting able to connect it first time.
Second time , as there is no one at server side is waiting for connection, it is failing.