package Program;
import Common.StaticValues;
import Common.Utils;
import Communication.Messages.TCP.TCPMessageService;
import Multicast.MulticastJsonReceivingThread;
import Multicast.MulticastWebProgram;
import java.io.*;
import java.nio.file.Path;
import java.nio.file.Paths;
public class Client
{
private static final String log = "Client.log";
public static void main(String[] args)
{
setupOutputFile();
try
{
while (true)
{
ClientManager.getInstance().getTCP();
Thread.sleep(1000);
}
}
catch (Exception e)
{
e.printStackTrace();
System.exit(1);
}
}
public static File getContainingFolder()
{
return Utils.getFolderForJarContainingClass(Client.class);
}
private static void setupOutputFile()
{
try
{
Path logPath = getContainingFolder().toPath().resolve(log);
System.setOut(new PrintStream(new BufferedOutputStream(new FileOutputStream(logPath.toFile())), true));
}
catch (FileNotFoundException e)
{
throw new RuntimeException(e);
}
}
}