{"id":28204104,"url":"https://github.com/vasylishchuk/chatconnect_server","last_synced_at":"2025-07-06T00:36:17.761Z","repository":{"id":243445389,"uuid":"812361970","full_name":"VasylIshchuk/ChatConnect_Server","owner":"VasylIshchuk","description":"A simple Java-based chat server implementation that supports basic client-server communication. The server listens for incoming client connections, handles message exchange, and supports multiple clients simultaneously. Ideal for understanding socket programming and building real-time messaging applications.","archived":false,"fork":false,"pushed_at":"2025-04-04T20:31:02.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-17T04:11:16.008Z","etag":null,"topics":["java","server","socket","study-project"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VasylIshchuk.png","metadata":{"files":{"readme":"README(example simple client).md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-08T17:07:47.000Z","updated_at":"2025-04-04T20:33:27.000Z","dependencies_parsed_at":"2025-04-04T21:26:24.550Z","dependency_job_id":"7b1f9f97-06af-49d8-a19f-77a2bccc36eb","html_url":"https://github.com/VasylIshchuk/ChatConnect_Server","commit_stats":null,"previous_names":["vasylishchuk/chatconnect_server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/VasylIshchuk/ChatConnect_Server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VasylIshchuk%2FChatConnect_Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VasylIshchuk%2FChatConnect_Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VasylIshchuk%2FChatConnect_Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VasylIshchuk%2FChatConnect_Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VasylIshchuk","download_url":"https://codeload.github.com/VasylIshchuk/ChatConnect_Server/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VasylIshchuk%2FChatConnect_Server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259759796,"owners_count":22907044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","server","socket","study-project"],"created_at":"2025-05-17T04:11:38.691Z","updated_at":"2025-06-14T04:31:24.386Z","avatar_url":"https://github.com/VasylIshchuk.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"package org.umcs.client;\n\nimport java.io.IOException;\nimport java.net.Socket;\nimport java.util.Scanner;\n\npublic class Client {\n    \n    public void connect(int port) throws IOException {\n        Socket clientSocket = new Socket(\"localhost\",port);\n        while(true) {\n          ClientHandler is responsible for connecting to the server and represents the client that receives the message\n            ClientHandler clientHandler = new ClientHandler(clientSocket);\n            Thread thread = new Thread(clientHandler);\n            thread.start();\n           Represents the client that sends the message\n            Scanner reader = new Scanner(System.in);\n            String message;\n            while((message = reader.nextLine())!= null){\n                clientHandler.send(message);\n                if (message.equals(\"/exit\")) System.exit(0);\n            }\n        }\n    }\n    \n}\n\npackage org.umcs.client;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.io.PrintWriter;\nimport java.net.Socket;\n\n\npublic class ClientHandler implements  Runnable{\n   \n    BufferedReader reader;\n    PrintWriter writer;\n\n    public ClientHandler(Socket clientSocket) throws IOException {\n        reader = new BufferedReader(\n                new InputStreamReader(\n                        clientSocket.getInputStream()\n                ));\n        writer = new PrintWriter(clientSocket.getOutputStream(),true);\n    }\n\n    @Override\n    public void run() {\n        String message;\n        try {\n            while((message = reader.readLine())!= null) System.out.println(message);\n        } catch (IOException e) {\n            throw new RuntimeException(e);\n        }\n    }\n\n    public void send(String message){\n        writer.println(message);\n    }\n    \n}\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasylishchuk%2Fchatconnect_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvasylishchuk%2Fchatconnect_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasylishchuk%2Fchatconnect_server/lists"}