Start the server when the repository get it.

This commit is contained in:
Jérémi N ‘EndMove’ 2022-02-26 17:53:53 +01:00
parent 8635ffcf82
commit 7cac782a61
Signed by: EndMove
GPG Key ID: 65C4A02E1F5371A4
2 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,7 @@ public class ClientHandlerRepository implements AutoCloseable, UnicastCHR {
/** /**
* Setter, allow to define the ServerListener of a repository. * Setter, allow to define the ServerListener of a repository.
* & Start the server.
* @param server ServerListener to set as default. * @param server ServerListener to set as default.
* *
* @since 1.0 * @since 1.0
@ -39,6 +40,7 @@ public class ClientHandlerRepository implements AutoCloseable, UnicastCHR {
@Override @Override
public void setServerListener(UnicastServerListener server) { public void setServerListener(UnicastServerListener server) {
this.server = server; this.server = server;
server.start();
} }
/** /**

View File

@ -31,6 +31,7 @@ public class StoreProcessorRepository implements AutoCloseable, MulticastSPR {
/** /**
* Setter, allow to define the ServerListener of a repository. * Setter, allow to define the ServerListener of a repository.
* & start the server.
* @param server ServerListener to set as default. * @param server ServerListener to set as default.
* *
* @since 1.0 * @since 1.0
@ -38,6 +39,7 @@ public class StoreProcessorRepository implements AutoCloseable, MulticastSPR {
@Override @Override
public void setServerListener(MulticastServerListener server) { public void setServerListener(MulticastServerListener server) {
this.server = server; this.server = server;
server.run();
} }
/** /**