Linked table to show games from received packets. #story[1188]
This commit is contained in:
@@ -19,6 +19,7 @@ public class MatchBrowserLobbyInterface extends Observable {
|
||||
private DatagramSocket socket;
|
||||
private MatchBrowserClientRunnable clientRunnable;
|
||||
private List<HostGame> games = new ArrayList<>();
|
||||
private Thread clientRunnableThread;
|
||||
|
||||
public MatchBrowserLobbyInterface() {
|
||||
|
||||
@@ -30,7 +31,7 @@ public class MatchBrowserLobbyInterface extends Observable {
|
||||
public void startReceivingHostData(DatagramSocket socket) {
|
||||
this.socket = socket;
|
||||
clientRunnable = new MatchBrowserClientRunnable(this, socket);
|
||||
Thread clientRunnableThread = new Thread(clientRunnable, "Socket: " + socket.toString());
|
||||
clientRunnableThread = new Thread(clientRunnable, "Socket: " + socket.toString());
|
||||
clientRunnableThread.start();
|
||||
}
|
||||
|
||||
@@ -61,9 +62,10 @@ public class MatchBrowserLobbyInterface extends Observable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Used to close the socket once out of the lobby
|
||||
* Used to close the socket and runnable once out of the lobby
|
||||
*/
|
||||
public void closeSocket() {
|
||||
clientRunnableThread.interrupt();
|
||||
this.socket.close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user