add acceptConnection() method and exemple of usage