Changeset 6417 in osm for applications/editors/josm


Ignore:
Timestamp:
2008-01-17T01:07:16+01:00 (17 years ago)
Author:
frederik
Message:

Properly re-connect after losing gpsd connection, and more debug output for LiveGPS plugin; patch by Gervase Markham <gerv@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/livegps/livegps/LiveGpsAcquirer.java

    r5057 r6417  
    111111                        fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus.CONNECTING, tr("Connecting"));
    112112                                                connected = true;
     113                                        System.out.println("LiveGps: Connected to gpsd");
    113114                                        }
    114115                                }
     
    195196                        }
    196197                }
    197         fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus.DISCONNECTED, tr("Not connected"));
    198                 if (gpsdSocket != null) try { gpsdSocket.close(); } catch (Exception ignore) {};
    199         }
    200    
    201 
     198   
     199    fireGpsStatusChangeEvent(LiveGpsStatus.GpsStatus.DISCONNECTED, tr("Not connected"));
     200                if (gpsdSocket != null) {
     201      try {
     202        gpsdSocket.close();
     203        gpsdSocket = null;
     204                        System.out.println("LiveGps: Disconnected from gpsd");
     205      }
     206      catch (Exception e) {
     207        System.out.println("LiveGps: Unable to close socket; reconnection may not be possible");
     208      };
     209          }
     210  }
    202211       
    203212        public void shutdown()
Note: See TracChangeset for help on using the changeset viewer.