in my main dialog.cpp//dialog-based app

if (serversock.create(8000,SOCK_STREAM,myIP) && serversock.listen())
display OK;

if (serversock.Accept(receivesock,0,0))
display OK;


Is this the method to wait for a connection request?

or should I do it in the OnAccept() of the socket class?
What is the usual method of waiting for connection request and where to accept the request?