Commit 50704d9d authored by Xiaoying Pu's avatar Xiaoying Pu

when I was rejoicing over the gender/science IAT, MouseTracker did not hesitate to crash

parent 75824a46
......@@ -19,7 +19,10 @@ import static util.UDPConstants.UDP_TIMEOUT;
* @author Xiaoying Pu <xp002@bucknell.edu>
*/
public class UDPController {
/**
* As opposed to a list of listeners because UDPController only needs one anyways.
* Remember to initialize it upstream of the UDPController, i.e., the PrimaryTaskController.
*/
private EventListener theListener;
private String message_received = "";
private String messageToSend = "";
......@@ -29,6 +32,7 @@ public class UDPController {
public UDPController() {
this.persisHandle = new Persistence("recv.csv", HEADER);
//setUp(); NOTE: should not be called at init
}
public void addListener(EventListener l) {
......@@ -112,7 +116,7 @@ public class UDPController {
Object[] data = UDPHandler.receive(HOST, RECEIVE_PORT, UDP_TIMEOUT, PACKET_LENGTH);
message_received = (String) data[0];
}
this.theListener.run(EventType.UDPMSG_FROM_MT);
//this.theListener.run(EventType.UDPMSG_FROM_MT);
// TODO: What is this doing????
String[] tempParts = message_received.split(",");
......
......@@ -41,7 +41,7 @@ public class Trial extends Thread {
this.theListener = new ResponseListener();
this.sFacade.addListener(theListener);
this.pFacade.addListener(theListener);
this.iterations = new AtomicInteger(0);
this.maxIteration = Configurator.getnTrials();
}
......
......@@ -21,8 +21,8 @@ public class UDPConstants {
*/
public static int NUM_TRIALS = 10;
public static int RECEIVE_PORT = 9223; // recv for this prgm, output port for MouseTracker
public static int SEND_PORT = 9001; // input port for mousetracker
public static int RECEIVE_PORT = 8001; // recv for this prgm, output port for MouseTracker
public static int SEND_PORT = 8000; // input port for mousetracker
public static String HOST = "127.0.0.1";// TO MouseTracker
public static int UDP_TIMEOUT = 20 * 1000; // in millisecond
public static int PACKET_LENGTH = 512;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment