Newer
Older
package com.example.schedulerapp;
import java.io.*;
import java.net.*;
import java.util.ArrayList;
import java.util.Arrays;
public class ReceiveThread extends Thread {
this.client = client;
try {
InputStream input = socket.getInputStream();
reader = new BufferedReader(new InputStreamReader(input));
} catch (IOException error) {
System.out.println("Error getting input stream: " + error.getMessage());
error.printStackTrace();
}
}
public void run() {
while(true) {
try {
//System.out.println("ReceiveThread.Run.Hello"); why does this run twice.
String[] args = response.split("/");
switch (args[0]) {
case "allEmployees" -> this.client.employees = new ArrayList<>(Arrays.asList(args));
case "allShifts" -> this.client.shifts = new ArrayList<>(Arrays.asList(args));