Merge branch 'master' of https://github.com/V2GClarity/RISE-V2G
This commit is contained in:
commit
0711b49b69
|
@ -139,6 +139,7 @@ public class TCPClient extends StatefulTransportLayerClient {
|
||||||
getInStream().close();
|
getInStream().close();
|
||||||
getOutStream().close();
|
getOutStream().close();
|
||||||
getTcpSocketToServer().close();
|
getTcpSocketToServer().close();
|
||||||
|
uniqueTCPClientInstance = null;
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
getLogger().error("Error occurred while trying to close TCP socket to server", e);
|
getLogger().error("Error occurred while trying to close TCP socket to server", e);
|
||||||
|
|
|
@ -220,6 +220,7 @@ public class TLSClient extends StatefulTransportLayerClient {
|
||||||
getInStream().close();
|
getInStream().close();
|
||||||
getOutStream().close();
|
getOutStream().close();
|
||||||
getTlsSocketToServer().close();
|
getTlsSocketToServer().close();
|
||||||
|
uniqueTLSClientInstance = null;
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
getLogger().error("Error occurred while trying to close TCP socket to server", e);
|
getLogger().error("Error occurred while trying to close TCP socket to server", e);
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class UDPClient {
|
||||||
* access the instance variable -> thread safe.
|
* access the instance variable -> thread safe.
|
||||||
*/
|
*/
|
||||||
private Logger logger = LogManager.getLogger(this.getClass().getSimpleName());
|
private Logger logger = LogManager.getLogger(this.getClass().getSimpleName());
|
||||||
private static final UDPClient uniqueUDPClientInstance = new UDPClient();
|
private static UDPClient uniqueUDPClientInstance = new UDPClient();
|
||||||
private int multicastSocketPort;
|
private int multicastSocketPort;
|
||||||
private Inet6Address multicastAddress;
|
private Inet6Address multicastAddress;
|
||||||
private MulticastSocket socketToUDPServer;
|
private MulticastSocket socketToUDPServer;
|
||||||
|
@ -105,7 +105,10 @@ public class UDPClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static UDPClient getInstance() {
|
public static synchronized UDPClient getInstance() {
|
||||||
|
if (uniqueUDPClientInstance == null) {
|
||||||
|
uniqueUDPClientInstance = new UDPClient();
|
||||||
|
}
|
||||||
return uniqueUDPClientInstance;
|
return uniqueUDPClientInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,6 +147,7 @@ public class UDPClient {
|
||||||
public void stop() {
|
public void stop() {
|
||||||
getSocketToUDPServer().close();
|
getSocketToUDPServer().close();
|
||||||
getLogger().debug("UDP client stopped");
|
getLogger().debug("UDP client stopped");
|
||||||
|
uniqueUDPClientInstance = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue