<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by kawtaralmai on Medium]]></title>
        <description><![CDATA[Stories by kawtaralmai on Medium]]></description>
        <link>https://medium.com/@almai.kawtar?source=rss-ce12ef87bf87------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*F2qg1Fh1bV97yxQ6uG-NNA.png</url>
            <title>Stories by kawtaralmai on Medium</title>
            <link>https://medium.com/@almai.kawtar?source=rss-ce12ef87bf87------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 07:51:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@almai.kawtar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Exploring Java Sockets Through a Multi-Client Chat Application]]></title>
            <link>https://medium.com/@almai.kawtar/exploring-java-sockets-through-a-multi-client-chat-application-e300d610864a?source=rss-ce12ef87bf87------2</link>
            <guid isPermaLink="false">https://medium.com/p/e300d610864a</guid>
            <category><![CDATA[javafx]]></category>
            <category><![CDATA[multi-client]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[kawtaralmai]]></dc:creator>
            <pubDate>Tue, 27 Oct 2026 22:18:06 GMT</pubDate>
            <atom:updated>2026-10-27T22:18:06.576Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Understanding TCP communication, virtual threads, and JavaFX through a real-time group chat.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_gK_YwfPl7p0ToGv" /><figcaption>Photo by <a href="https://unsplash.com/@lunarts?utm_source=medium&amp;utm_medium=referral">Volodymyr Hryshchenko</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Introduction</h3><p>How can multiple users communicate in real time through a single application?</p><p>This project explores the answer through a Multi-Client Chat Application built with Java 21, TCP Sockets, Virtual Threads, and JavaFX.</p><p>Created as part of Mini Project 1 for Advanced Distributed Programming Paradigms at Al Akhawayn University in Ifrane, the application demonstrates how multiple clients can connect to a central server and participate in a shared conversation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*SWf3DS4urq97uZvgun_2MQ.png" /><figcaption>Client Interface — Real-time group conversation</figcaption></figure><h3>Architecture</h3><p>The application follows a client-server architecture.</p><p>A central server manages connections, receives messages, and distributes them to connected clients.</p><p>The communication flow is straightforward:</p><ol><li>A client connects to the server through a TCP socket.</li><li>The client sends a message.</li><li>The server processes and formats the message.</li><li>The server distributes it to the connected clients.</li></ol><p>TCP provides reliable, ordered communication, while a simple text-based protocol defines how application messages are exchanged.</p><h3>Handling Multiple Clients</h3><p>The server uses Java virtual threads to handle concurrent client connections.</p><p>Each client has an independent handler responsible for receiving messages, processing commands, and managing its connection.</p><p>Virtual threads provide a lightweight approach to concurrency, making it possible to handle multiple clients while maintaining a straightforward programming model.</p><h3>Key Features</h3><p>The application includes:</p><ul><li>Real-time group messaging with usernames and timestamps.</li><li>Username-based participation and read-only mode.</li><li>Active user inquiry through the allUsers command.</li><li>Disconnection using end, bye, or the LEAVE button.</li><li>A JavaFX server interface displaying connected users and activity logs.</li><li>Runtime configuration through config.properties.</li></ul><h3>Model-View Separation</h3><p>The application separates networking logic from the graphical interface.</p><p>The <strong>Model</strong> handles sockets, connections, commands, and message processing.</p><p>The <strong>View</strong>, built with JavaFX, displays the chat interface and server monitoring information.</p><p>Listener interfaces allow the Model to notify the View about incoming messages, user connections, and disconnections without depending directly on JavaFX.</p><p>This separation makes the application easier to maintain and extend.</p><h3>Technical Insights</h3><p>This project highlights several important concepts in distributed programming:</p><ul><li><strong>TCP is a stream:</strong> Application-level messages require their own delimiters and protocol.</li><li><strong>Concurrency requires coordination:</strong> Multiple clients share server resources, making connection management important.</li><li><strong>UI updates require attention:</strong> JavaFX updates must be performed on the JavaFX Application Thread.</li><li><strong>Separation of concerns matters:</strong> Keeping networking logic independent from the interface improves maintainability.</li></ul><h3>Conclusion</h3><p>This project provides a practical exploration of Java networking and distributed programming.</p><p>It brings together TCP communication, virtual threads, JavaFX, and software architecture to demonstrate how a real-time group chat application operates.</p><p>It also highlights the importance of understanding the underlying concepts when using AI-assisted development tools to build software.</p><h3>Project Resources</h3><ul><li><a href="https://github.com/almaikawtar/MultiClientChat">GitHub Repository</a></li></ul><p><em>Mini Project 1 — Advanced Distributed Programming Paradigms, Al Akhawayn University in Ifrane.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e300d610864a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>