Merge remote-tracking branch 'origin/splitIntoTwoModules' into splitIntoTwoModules
This commit is contained in:
@@ -18,6 +18,7 @@ public class MockOutput
|
||||
private RaceVisionByteEncoder messageEncoder = new RaceVisionByteEncoder();
|
||||
|
||||
//socket port 4942 as 4940 is ac35 live port and 4941 is ac35 test port
|
||||
private ServerSocket serverSocket;
|
||||
private Socket mockSocket;
|
||||
private DataOutputStream outToVisualiser;
|
||||
|
||||
@@ -32,6 +33,23 @@ public class MockOutput
|
||||
|
||||
|
||||
MockOutput() throws IOException{
|
||||
/**************sockets*******************/
|
||||
//start Time
|
||||
lastHeartbeatTime = System.currentTimeMillis();
|
||||
|
||||
|
||||
// mockSocket = new Socket("localhost", 4942);
|
||||
serverSocket = new ServerSocket(4942);
|
||||
// mockSocket = serverSocket.accept();
|
||||
|
||||
|
||||
|
||||
|
||||
//loop that sends
|
||||
while (true){
|
||||
mockSocket = serverSocket.accept();
|
||||
outToVisualiser = new DataOutputStream(mockSocket.getOutputStream());
|
||||
|
||||
/*******************************Test********************************/
|
||||
StringBuilder xmlString;
|
||||
|
||||
@@ -48,20 +66,10 @@ public class MockOutput
|
||||
|
||||
/*******************************Test********************************/
|
||||
|
||||
/**************sockets*******************/
|
||||
//start Time
|
||||
lastHeartbeatTime = System.currentTimeMillis();
|
||||
|
||||
|
||||
mockSocket = new Socket("localhost", 4942);
|
||||
outToVisualiser = new DataOutputStream(mockSocket.getOutputStream());
|
||||
|
||||
|
||||
//loop that sends
|
||||
while(true)
|
||||
{
|
||||
while(true) {
|
||||
try {
|
||||
//sends a heartbeat every 5 seconds
|
||||
if (timeSinceHeartbeat() >= 5.00){
|
||||
if (timeSinceHeartbeat() >= 5.00) {
|
||||
outToVisualiser.write(heartbeat());
|
||||
lastHeartbeatTime = System.currentTimeMillis();
|
||||
}
|
||||
@@ -75,6 +83,11 @@ public class MockOutput
|
||||
//cleans out buffer
|
||||
messagesToSendBuffer.clear();
|
||||
}
|
||||
}catch(SocketException e){
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/**************sockets*******************/
|
||||
}
|
||||
|
||||
@@ -36,8 +36,10 @@ public class VisualiserInput
|
||||
// ServerSocket visualiserSocket = new ServerSocket(4942);
|
||||
// Socket connectionSocket = visualiserSocket.accept();
|
||||
|
||||
Socket connectionSocket = new Socket(InetAddress.getLocalHost(), 4942);
|
||||
|
||||
//this is the test data that streams form the AC35 website
|
||||
Socket connectionSocket = new Socket("livedata.americascup.com",4941);
|
||||
// Socket connectionSocket = new Socket("livedata.americascup.com",4941);
|
||||
|
||||
|
||||
//start Time
|
||||
|
||||
Reference in New Issue
Block a user