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