From b2cf8bfe22c1c4430d342f30b797170f7acf4005 Mon Sep 17 00:00:00 2001 From: Chris Board Date: Wed, 17 Jan 2018 23:03:27 +0000 Subject: [PATCH] Removed some debug Removed debug to avoid writing to stdout --- DataDogStatsD.cpp | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/DataDogStatsD.cpp b/DataDogStatsD.cpp index cb68ceb..156ee7e 100644 --- a/DataDogStatsD.cpp +++ b/DataDogStatsD.cpp @@ -249,7 +249,6 @@ void DataDogStatsD::send(std::map data, float sampleRate, string void DataDogStatsD::flush(string& udp_message) { #ifndef _WIN32 - cout << "Sending " << udp_message << endl; int udp_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); /*struct sockaddr_in sin; @@ -271,23 +270,10 @@ void DataDogStatsD::flush(string& udp_message) cout << "Failed to bind UDP port" << endl; }*/ - int connect_result = connect(udp_socket, (struct sockaddr *) &serv_addr, sizeof(serv_addr)); - if (connect_result < 0) - { - cout << "Failed to connect" << endl; - cout << "Error: " << strerror(connect_result) << endl; - } + connect(udp_socket, (struct sockaddr *) &serv_addr, sizeof(serv_addr)); - int sentBytes = write(udp_socket, udp_message.c_str(), udp_message.length()); - if (sentBytes >= 0) - { - cout << "Sent " << sentBytes << "bytes" << endl; - } - else - { - cout << "Failed to send data" << endl; - cout << "Error: " << strerror(sentBytes) << endl; - } + write(udp_socket, udp_message.c_str(), udp_message.length()); + close(udp_socket); #else