From c890b0748a47a88c832984f95070ddf3d232cc08 Mon Sep 17 00:00:00 2001 From: Aleksi Lindeman Date: Tue, 9 Apr 2019 20:58:18 +0200 Subject: Add debug output --- src/DirectConnection.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/DirectConnection.cpp') diff --git a/src/DirectConnection.cpp b/src/DirectConnection.cpp index 6869d05..453f6b6 100644 --- a/src/DirectConnection.cpp +++ b/src/DirectConnection.cpp @@ -194,7 +194,7 @@ namespace sibs std::unique_ptr DirectConnections::createSocket(const Ipv4 &addressToBind, bool rendezvous, bool reuseAddr, bool bind) { - Log::debug("UDT: Creating socket for ipv4 address %s, port: %d", addressToBind.getAddress().c_str(), addressToBind.getPort()); + //Log::debug("UDT: Creating socket for ipv4 address %s, port: %d", addressToBind.getAddress().c_str(), addressToBind.getPort()); UDTSOCKET udtSocket = UDT::socket(AF_INET, SOCK_DGRAM, 0); if(udtSocket == UDT::INVALID_SOCK) { @@ -300,7 +300,9 @@ namespace sibs int socketId = socket->udtSocket; - Log::debug("DirectConnections: Connecting to %s peer (ip: %s, port: %d, rendezvous: %s)", server ? "server" : "client", address.getAddress().c_str(), address.getPort(), rendezvous ? "yes" : "no"); + Log::debug("DirectConnections: Connecting to %s peer (ip: %s, port: %d, rendezvous: %s, p2p: %s)", server ? "server" : "client", + address.getAddress().c_str(), address.getPort(), rendezvous ? "yes" : "no", options.useP2p ? "yes" : "no"); + if((!server && !options.useP2p) || UDT::connect(socketId, (sockaddr*)&address.address, sizeof(address.address)) == UDT::ERROR) { if(!server) -- cgit v1.2.3