]> git.sesse.net Git - cubemap/blobdiff - udpinput.cpp
Identify UDPInput error messages by the stream, too.
[cubemap] / udpinput.cpp
index 081f631c47e114ba42f7ff46699667d8d1d31c5e..ed53edeea073604d93de240ffea6b5c7d04d323d 100644 (file)
@@ -61,7 +61,7 @@ void UDPInput::close_socket()
        } while (ret == -1 && errno == EINTR);
 
        if (ret == -1) {
        } while (ret == -1 && errno == EINTR);
 
        if (ret == -1) {
-               perror("close()");
+               log_perror("close()");
        }
 
        sock = -1;
        }
 
        sock = -1;
@@ -85,7 +85,8 @@ void UDPInput::do_work()
                        int port_num = atoi(port.c_str());
                        sock = create_server_socket(port_num, UDP_SOCKET);
                        if (sock == -1) {
                        int port_num = atoi(port.c_str());
                        sock = create_server_socket(port_num, UDP_SOCKET);
                        if (sock == -1) {
-                               log(WARNING, "UDP socket creation failed. Waiting 0.2 seconds and trying again...");
+                               log(WARNING, "[%s] UDP socket creation failed. Waiting 0.2 seconds and trying again...",
+                                            stream_id.c_str());
                                usleep(200000);
                                continue;
                        }
                                usleep(200000);
                                continue;
                        }
@@ -102,7 +103,7 @@ void UDPInput::do_work()
                        continue;
                }
                if (nfds == -1) {
                        continue;
                }
                if (nfds == -1) {
-                       perror("poll");
+                       log_perror("poll");
                        close_socket();
                        continue;       
                }
                        close_socket();
                        continue;       
                }
@@ -114,7 +115,7 @@ void UDPInput::do_work()
                } while (ret == -1 && errno == EINTR);
 
                if (ret <= 0) {
                } while (ret == -1 && errno == EINTR);
 
                if (ret <= 0) {
-                       perror("recv");
+                       log_perror("recv");
                        close_socket();
                        continue;
                }
                        close_socket();
                        continue;
                }