- // Warn about any servers we've lost.
- // TODO: Make an option (delete=yes?) to actually shut down streams.
- for (set<string>::const_iterator stream_it = expecting_stream_ids.begin();
- stream_it != expecting_stream_ids.end();
- ++stream_it) {
- string stream_id = *stream_it;
- fprintf(stderr, "WARNING: stream '%s' disappeared from the configuration file.\n",
- stream_id.c_str());
- fprintf(stderr, " It will not be deleted, but clients will not get any new inputs.\n");
- if (deserialized_inputs.count(stream_id) != 0) {
- delete deserialized_inputs[stream_id];
- deserialized_inputs.erase(stream_id);
- }
- }
-
- // Open a new server socket if we do not already have one, or if we changed ports.
- if (server_sock != -1 && port != old_port) {
- fprintf(stderr, "NOTE: Port changed from %d to %d; opening new socket.\n", old_port, port);
- close(server_sock);
- server_sock = -1;
- }
- if (server_sock == -1) {
- server_sock = create_server_socket(port);