Changeset 5627 for source/ariba/utility/transport/rfcomm
- Timestamp:
- Aug 3, 2009, 4:33:50 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/utility/transport/rfcomm/rfcomm.cpp
r5614 r5627 33 33 public: 34 34 link_info(io_service& io ) : 35 io(io), up(false), local(), remote(), socket(new bluetooth::rfcomm::socket(io)), connect_retries(0),35 io(io), up(false), connecting(false), local(), remote(), socket(new bluetooth::rfcomm::socket(io)), connect_retries(0), 36 36 size(0), buffer(NULL), sending(false) { 37 37 } … … 51 51 // state 52 52 bool up; 53 bool connecting; 53 54 rfcomm_endpoint local, remote; 54 55 bluetooth::rfcomm::socket* socket; … … 136 137 137 138 // not found, or not up? ->try to (re-)connect 138 if (info==NULL || !info->up || !info->socket->is_open() ) {139 if (info==NULL || ((!info->up || !info->socket->is_open()) && !info->connecting) ) { 139 140 logging_debug( "Connecting to " << endpoint.to_string() ); 140 141 if (info != NULL && (!info->up || !info->socket->is_open())) { … … 146 147 info->connect_retries = 0; 147 148 info->remote = endpoint; 149 info->connecting = true; 148 150 info->socket->async_connect( convert(endpoint), boost::bind( 149 151 &rfcomm::handle_connect, this, 150 152 boost::asio::placeholders::error, info 151 153 )); 154 links.push_back(info); 152 155 } 153 156 … … 260 263 if (info->connect_retries<3) { 261 264 // increase counter 265 info->connecting = false; 262 266 info->connect_retries++; 263 267 info->reinit(); … … 276 280 // convert endpoints 277 281 info->up = true; 282 info->connecting = false; 278 283 info->local = convert( info->socket->local_endpoint() ); 279 284 info->remote = convert( info->socket->remote_endpoint() );
Note:
See TracChangeset
for help on using the changeset viewer.