Microsoft has some pretty good examples for sockets, both synchronous and asynchronous.
It is a good start for you I think.
Socket Code Examples[
^]
When it comes to your wish to make the server send a command and the client to wait, what you basically want is to let the client become the server and vice versa.
The client-server model means that the server waits for something to do and the clients make requests.
What you can do is to let the client hook up to the server and then create a new connection where the client is the server, and then close the first connection.
It seems like a complicated setup to me, but it is technically possible.