while (1) { $new_conn = do_select(); add_connection( $new_conn ) if $new_conn; read_all_connections(); process_data(); write_all_connections(); }