Support UDP input. Also fix some issues with socket closing.
[cubemap] / main.cpp
index 25f82eb..d77fb2e 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -215,7 +215,7 @@ vector<Acceptor *> create_acceptors(
                        acceptor = deserialized_acceptor_it->second;
                        deserialized_acceptors->erase(deserialized_acceptor_it);
                } else {
-                       int server_sock = create_server_socket(port);
+                       int server_sock = create_server_socket(port, TCP_SOCKET);
                        acceptor = new Acceptor(server_sock, port);
                }
                acceptor->run();
@@ -262,6 +262,7 @@ vector<Input *> create_inputs(const vector<ConfigLine> &config,
                        if (input->get_url() != src) {
                                fprintf(stderr, "INFO: Stream '%s' has changed URL from '%s' to '%s', restarting input.\n",
                                        stream_id.c_str(), input->get_url().c_str(), src.c_str());
+                               input->close_socket();
                                delete input;
                                input = NULL;
                        }