Fix reconnect
This commit is contained in:
		
					parent
					
						
							
								dd3f3df16d
							
						
					
				
			
			
				commit
				
					
						3e49166308
					
				
			
		
					 3 changed files with 4 additions and 4 deletions
				
			
		|  | @ -9,8 +9,8 @@ public abstract class ThunderProvider { | |||
| 	private final ArrayList<Consumer<TimedStrike>> strikeHandlers = new ArrayList<>(); | ||||
| 	private final ArrayList<Consumer<ThunderProviderEvent>> eventHandlers = new ArrayList<>(); | ||||
| 
 | ||||
| 	private long latencyMillis; | ||||
| 	private int latencySamplesCount; | ||||
| 	private long latencyMillis = 0; | ||||
| 	private int latencySamplesCount = 0; | ||||
| 	 | ||||
| 	/** | ||||
| 	 * Connect to the provider and start to process data | ||||
|  |  | |||
|  | @ -43,7 +43,7 @@ public class BlitzortungProvider extends ThunderProvider { | |||
| 
 | ||||
| 				Thread.sleep(3000); | ||||
| 				submitEvent("Reconnecting"); | ||||
| 				websocketClient.connectBlocking(); | ||||
| 				websocketClient.reconnectBlocking(); | ||||
| 			} catch (InterruptedException e) { | ||||
| 				submitEvent("Failed to reconnect", e); | ||||
| 			} | ||||
|  |  | |||
|  | @ -82,7 +82,7 @@ class BlitzortungWebsocketClient extends WebSocketClient { | |||
| 
 | ||||
| 	@Override | ||||
| 	public void onClose(int code, String reason, boolean remote) { | ||||
| 		blitzortungProvider.wsSubmitEvent("Websocket closed: %s".formatted(reason), null); | ||||
| 		blitzortungProvider.wsSubmitEvent("Websocket closed: %d %s".formatted(code, reason), null); | ||||
| 
 | ||||
| 		this.uri = uris[++currentUri % uris.length]; | ||||
| 		blitzortungProvider.reconnect(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Minecon724
				Minecon724