Login and Register with UI

This commit is contained in:
2025-06-04 22:54:24 +03:30
parent 108a6d8b81
commit 86ca58481f
21 changed files with 1166 additions and 0 deletions
@@ -0,0 +1,28 @@
package org.to.telegramfinalproject.Server;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
public class MainServer {
private static final int PORT = 12345;
public static void main(String[] args) {
try (ServerSocket serverSocket = new ServerSocket(PORT)) {
System.out.println("Server started on port " + PORT);
while (true) {
Socket clientSocket = serverSocket.accept();
System.out.println("New client connected: " + clientSocket.getInetAddress());
ClientHandler handler = new ClientHandler(clientSocket);
new Thread(handler).start();
}
} catch (IOException e) {
System.err.println("Server error: " + e.getMessage());
e.printStackTrace();
}
}
}