Changeset 14577 for trunk/FACT++
- Timestamp:
- 11/07/12 12:03:03 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/Connection.cc
r14179 r14577 399 399 } 400 400 401 tcp::resolver resolver(get_io_service());401 const bool valid = !fAddress.empty() || !fPort.empty(); 402 402 403 403 boost::system::error_code ec; 404 404 405 tcp::resolver::query query(fAddress, fPort);406 tcp::resolver::iterator iterator = resolver.resolve(query, ec);407 408 405 ostringstream msg; 409 if (!fAddress.empty() || !fPort.empty() || ec) 406 if (!valid) 407 msg << "No target address... connection attempt postponed."; 408 else 409 { 410 tcp::resolver resolver(get_io_service()); 411 412 tcp::resolver::query query(fAddress, fPort); 413 tcp::resolver::iterator iterator = resolver.resolve(query, ec); 414 410 415 msg << "Trying to connect to " << URL() << "..."; 411 416 412 if (ec) 413 msg << " " << ec.message() << " (" << ec << ")"; 417 // Start connection attempts (will also reset deadline counter) 418 if (!ec) 419 AsyncConnect(iterator); 420 else 421 msg << " " << ec.message() << " (" << ec << ")"; 422 } 414 423 415 424 // Only output message if it has changed … … 423 432 } 424 433 425 if ( ec)434 if (!valid || ec) 426 435 AsyncWait(fConnectionTimer, 250, &Connection::HandleConnectionTimer); 427 else428 // Start connection attempts (will also reset deadline counter)429 AsyncConnect(iterator);430 436 } 431 437
Note:
See TracChangeset
for help on using the changeset viewer.