|
|
|
@ -16,13 +16,13 @@ public class RaceConnection {
|
|
|
|
private final StringProperty status;
|
|
|
|
private final StringProperty status;
|
|
|
|
private final StringProperty gamename;
|
|
|
|
private final StringProperty gamename;
|
|
|
|
|
|
|
|
|
|
|
|
public RaceConnection(String hostname, int port, String gamename) {
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Constructor for remote host connections.
|
|
|
|
* Constructor for remote host connections.
|
|
|
|
* @param hostname URL for remote host
|
|
|
|
* @param hostname URL for remote host
|
|
|
|
* @param port port for game feed
|
|
|
|
* @param port port for game feed
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public RaceConnection(String hostname, int port) {
|
|
|
|
public RaceConnection(String hostname, int port, String gamename) {
|
|
|
|
this.hostname = new SimpleStringProperty(hostname);
|
|
|
|
this.hostname = new SimpleStringProperty(hostname);
|
|
|
|
this.port = port;
|
|
|
|
this.port = port;
|
|
|
|
this.status = new SimpleStringProperty("");
|
|
|
|
this.status = new SimpleStringProperty("");
|
|
|
|
@ -34,7 +34,6 @@ public class RaceConnection {
|
|
|
|
* Tries to create a socket to hostname and port, indicates status after test.
|
|
|
|
* Tries to create a socket to hostname and port, indicates status after test.
|
|
|
|
* @return true if socket can connect
|
|
|
|
* @return true if socket can connect
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@SuppressWarnings("unused")
|
|
|
|
|
|
|
|
public boolean check() {
|
|
|
|
public boolean check() {
|
|
|
|
//TODO the connection needs to be moved to its own thread, so it doesn't block fx thread.
|
|
|
|
//TODO the connection needs to be moved to its own thread, so it doesn't block fx thread.
|
|
|
|
InetSocketAddress i = new InetSocketAddress(hostname.get(), port);
|
|
|
|
InetSocketAddress i = new InetSocketAddress(hostname.get(), port);
|
|
|
|
|