Changeset 5423


Ignore:
Timestamp:
Jul 29, 2009, 2:49:29 PM (15 years ago)
Author:
mies
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/utility/transport/rfcomm/rfcomm.cpp

    r5422 r5423  
    124124
    125125        // not found, or not up? ->try to (re-)connect
    126         if (info==NULL || !info->up) {
     126        if (info==NULL || !info->up || info->socket.is_open() ) {
    127127                logging_debug( "Connecting to " << endpoint.to_string() );
    128                 if (info != NULL && !info->up) {
     128                if (info != NULL && (!info->up || !info->socket.is_open())) {
    129129                        logging_debug("Old link is down. Trying to re-establish link.");
    130130                } else {
    131131                        info = new link_info(io);
    132132                }
     133                info->connect_retries = 0;
    133134                info->remote = endpoint;
    134135                info->socket.async_connect( convert(endpoint), boost::bind(
     
    216217        }
    217218
     219        links_mutex.lock();
     220
    218221        // convert endpoints
    219222        info->up = true;
     
    221224        info->remote = convert( info->socket.remote_endpoint() );
    222225
    223         logging_debug("Accepting incoming connection from "
     226        logging_debug("Accepted incoming connection from "
    224227                << info->remote.to_string() );
    225228
    226229        // add to list
    227         links_mutex.lock();
    228230        links.push_back(info);
    229231        links_mutex.unlock();
Note: See TracChangeset for help on using the changeset viewer.