Improving examples; adding new modes for closing sockets.