очистка отладочной печати. тоже кое-что накопилось.
This commit is contained in:
@@ -132,10 +132,8 @@ public class BugReport extends rDBObject {
|
||||
);
|
||||
if (!project_version.isEmpty()) {
|
||||
if (visualiser_version < 1134) {
|
||||
System.out.println("old bug");
|
||||
res.add(getSettingsJson().getSummary());
|
||||
} else {
|
||||
System.out.println("new bug");
|
||||
res.add(getPropertiesJson().getSummary());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ public abstract class RepositoryClient {
|
||||
if (isPrintOn()) {
|
||||
FileWriter testLog = new FileWriter(getClass().getSimpleName() + "_Log.txt", true);
|
||||
String dmessage = Utils_.Brackets(new Date()) + " " + message;
|
||||
System.out.println(dmessage);
|
||||
testLog.write(dmessage + "\n");
|
||||
testLog.close();
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import java.util.Vector;
|
||||
public abstract class RepositoryServer<D extends Database> {
|
||||
public final static String separator = "----------------------------------";
|
||||
protected static FileWriter Log;
|
||||
protected static boolean printOn = false;
|
||||
protected static boolean printOn = true;
|
||||
//-
|
||||
public D db;
|
||||
protected Socket clientSocket; //сокет для общения
|
||||
@@ -48,12 +48,22 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
return null;
|
||||
});
|
||||
Class<D> d_class;
|
||||
//-----------
|
||||
//-----------RECURSION ->
|
||||
SignalHandler signalHandler = signal -> {
|
||||
};
|
||||
public RepositoryServer(Class<D> d_class_in) {
|
||||
d_class = d_class_in;
|
||||
}
|
||||
protected static void ResetLog(){
|
||||
if (printOn){
|
||||
try {
|
||||
Log = new FileWriter("Log.txt", false);
|
||||
Log.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
protected static void Print(String message) {
|
||||
if (printOn) {
|
||||
try {
|
||||
@@ -167,11 +177,11 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
interruptThread.start();
|
||||
startAdditionalThreads();
|
||||
server = new ServerSocket(getPort());
|
||||
Print("Сервер запущен!");
|
||||
StartAction();
|
||||
while (true) {
|
||||
try {
|
||||
clientSocket = server.accept();
|
||||
ResetLog();
|
||||
Print((count++) + " клиент присоединился, IP=" + clientSocket.getInetAddress());
|
||||
code = ServerCode.Undefined;
|
||||
out = new ObjectOutputStream(clientSocket.getOutputStream());
|
||||
@@ -181,7 +191,7 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
DBObject dbObject = null;
|
||||
Pair<Class, Object> p = null;
|
||||
Print("Ожидание команды от клиента...");
|
||||
Object transport = in.readObject();
|
||||
Object transport = in.readObject(); //может висеть!!!!
|
||||
Print("Команда прочитана.");
|
||||
if (transport instanceof ServerExchangeUnit_2021) {
|
||||
request = (ServerExchangeUnit_2021) transport;
|
||||
|
||||
Reference in New Issue
Block a user