mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-25 06:56:15 +02:00
use asio socket::native_handle instead of native
This commit is contained in:
parent
ff455df0e0
commit
9561a8e92b
3 changed files with 9 additions and 9 deletions
|
@ -60,10 +60,10 @@ std::string ClientConnection::getMacAddress() const
|
||||||
if (socket_ == nullptr)
|
if (socket_ == nullptr)
|
||||||
throw SnapException("socket not connected");
|
throw SnapException("socket not connected");
|
||||||
|
|
||||||
std::string mac = ::getMacAddress(socket_->native());
|
std::string mac = ::getMacAddress(socket_->native_handle());
|
||||||
if (mac.empty())
|
if (mac.empty())
|
||||||
mac = "00:00:00:00:00:00";
|
mac = "00:00:00:00:00:00";
|
||||||
logO << "My MAC: \"" << mac << "\", socket: " << socket_->native() << "\n";
|
logO << "My MAC: \"" << mac << "\", socket: " << socket_->native_handle() << "\n";
|
||||||
return mac;
|
return mac;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,9 +78,9 @@ void ClientConnection::start()
|
||||||
// struct timeval tv;
|
// struct timeval tv;
|
||||||
// tv.tv_sec = 5;
|
// tv.tv_sec = 5;
|
||||||
// tv.tv_usec = 0;
|
// tv.tv_usec = 0;
|
||||||
// cout << "socket: " << socket->native() << "\n";
|
// cout << "socket: " << socket->native_handle() << "\n";
|
||||||
// setsockopt(socket->native(), SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
|
// setsockopt(socket->native_handle(), SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
|
||||||
// setsockopt(socket->native(), SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
// setsockopt(socket->native_handle(), SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
||||||
socket_->connect(*iterator);
|
socket_->connect(*iterator);
|
||||||
connected_ = true;
|
connected_ = true;
|
||||||
logS(kLogNotice) << "Connected to " << socket_->remote_endpoint().address().to_string() << endl;
|
logS(kLogNotice) << "Connected to " << socket_->remote_endpoint().address().to_string() << endl;
|
||||||
|
|
|
@ -102,8 +102,8 @@ void ControlServer::handleAccept(socket_ptr socket)
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
tv.tv_sec = 5;
|
tv.tv_sec = 5;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
setsockopt(socket->native(), SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
|
setsockopt(socket->native_handle(), SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
|
||||||
setsockopt(socket->native(), SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
setsockopt(socket->native_handle(), SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
||||||
// socket->set_option(boost::asio::ip::tcp::no_delay(false));
|
// socket->set_option(boost::asio::ip::tcp::no_delay(false));
|
||||||
logS(kLogNotice) << "ControlServer::NewConnection: " << socket->remote_endpoint().address().to_string() << endl;
|
logS(kLogNotice) << "ControlServer::NewConnection: " << socket->remote_endpoint().address().to_string() << endl;
|
||||||
shared_ptr<ControlSession> session = make_shared<ControlSession>(this, socket);
|
shared_ptr<ControlSession> session = make_shared<ControlSession>(this, socket);
|
||||||
|
|
|
@ -341,8 +341,8 @@ void StreamServer::handleAccept(socket_ptr socket)
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
tv.tv_sec = 5;
|
tv.tv_sec = 5;
|
||||||
tv.tv_usec = 0;
|
tv.tv_usec = 0;
|
||||||
setsockopt(socket->native(), SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
|
setsockopt(socket->native_handle(), SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
|
||||||
setsockopt(socket->native(), SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
setsockopt(socket->native_handle(), SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
|
||||||
logS(kLogNotice) << "StreamServer::NewConnection: " << socket->remote_endpoint().address().to_string() << endl;
|
logS(kLogNotice) << "StreamServer::NewConnection: " << socket->remote_endpoint().address().to_string() << endl;
|
||||||
shared_ptr<StreamSession> session = make_shared<StreamSession>(this, socket);
|
shared_ptr<StreamSession> session = make_shared<StreamSession>(this, socket);
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue