Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
10.7.x.x (relative to 10.7.2.0)
========

Build
-----

- Boost : Added compatibility with Boost 1.88.0.

10.7.2.0 (relative to 10.7.1.3)
========
Expand Down
14 changes: 9 additions & 5 deletions src/IECoreImage/ClientDisplayDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class ClientDisplayDriver::PrivateData : public RefCounted
m_socket.close();
}

boost::asio::io_service m_service;
boost::asio::io_context m_service;
std::string m_host;
std::string m_port;
bool m_scanLineOrderOnly;
Expand All @@ -96,17 +96,21 @@ ClientDisplayDriver::ClientDisplayDriver( const Imath::Box2i &displayWindow, con
m_data->m_port = displayPortData->readable();

tcp::resolver resolver(m_data->m_service);
tcp::resolver::query query(m_data->m_host, m_data->m_port);

boost::system::error_code error;
tcp::resolver::iterator iterator = resolver.resolve( query, error );
auto endpoints = resolver.resolve( m_data->m_host, m_data->m_port, tcp::resolver::address_configured, error );
if( !error )
{
error = boost::asio::error::host_not_found;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think maybe this line is unnecessary now? It looks like before it was needed to get into the first iteration of the while(), but that's no longer the case.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did wonder about that line. I originally wanted to remove it based on the same thought you had, but then I second-guessed myself thinking it might still be important to flag the "we didn't resolve anything" case. Happy to drop it if it is actually unnecessary...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see what you mean. Seems like that would only be used if there were no endpoints? Because otherwise we'd have called connect() and would have the true error from that. Since I have no idea if endpoints can be empty or not, seems best to stick with keeping it as you did already. Sorry for the noise...

while( error && iterator != tcp::resolver::iterator() )
for( const auto &e : endpoints )
{
m_data->m_socket.close();
m_data->m_socket.connect( *iterator++, error );
m_data->m_socket.connect( e, error );

if( !error )
{
break;
}
}
}
if( error )
Expand Down
6 changes: 3 additions & 3 deletions src/IECoreImage/DisplayDriverServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class DisplayDriverServer::Session : public RefCounted
{
public:

Session( boost::asio::io_service& io_service, MergeMap& mergeMap );
Session( boost::asio::io_context& io_service, MergeMap& mergeMap );
~Session() override;

boost::asio::ip::tcp::socket& socket();
Expand Down Expand Up @@ -135,7 +135,7 @@ class DisplayDriverServer::PrivateData : public RefCounted
public :

boost::asio::ip::tcp::endpoint m_endpoint;
boost::asio::io_service m_service;
boost::asio::io_context m_service;
boost::asio::ip::tcp::acceptor m_acceptor;
std::thread m_thread;
MergeMap m_mergeMap;
Expand Down Expand Up @@ -320,7 +320,7 @@ void DisplayDriverServer::handleAccept( DisplayDriverServer::SessionPtr session,
* DisplayDriverServer::Session functions
*/

DisplayDriverServer::Session::Session( boost::asio::io_service& io_service, MergeMap& mergeMap ) :
DisplayDriverServer::Session::Session( boost::asio::io_context& io_service, MergeMap& mergeMap ) :
m_socket( io_service ), m_displayDriver(nullptr), m_buffer( new CharVectorData( ) ), m_mergeMap( mergeMap )
{
}
Expand Down
Loading