The most straightforward way of implementing such a thing would be to use separate threads. (Look to your particular programming language for information about multi-threaded programming.) Assuming you know how to create a thread in your programming language, have one thread be the "accept connection" thread. It just sits and waits for an incoming connection by calling AcceptNextConnection. When a connection is received, AcceptNextConnection returns the connected socket object, and you can start a new thread to specifically handle that connection. You would pass the connected socket object to the new thread, which now owns it. Meanwhile, your "accept connection" thread, just loops to call AcceptNextConnection again to receive the next incoming connection, etc..