/// Terminate the sending of tuples public void terminate() { if (state == RUNNING || state == END || state == PAUSED) timer.cancel(); synchronized (this) { state = TERMINATED; } try { socket.close(); } catch (IOException e) { System.out.println("Error closing socket"); } }
public SystimeTableFeeder(NamedTable table, Socket socket, String fileName, boolean isLooped) throws IOException { this.socket = socket; this.table = table; this.isLooped = isLooped; this.out = new PrintWriter(new BufferedOutputStream(socket.getOutputStream())); this.fileName = fileName; File f = new File(fileName); in = new BufferedReader(new FileReader(f)); state = START; }