Multi Thread Server Client

Posted on 2006-06-01
Last Modified: 2008-03-17
Basically I want to make something similar to a messenger, or rather to IRC.

Server wait for clients to connect, if a client connects, a thread its created for him. I plan to make a swing graphical interface for Client, with a text box for user to write his message and a send button to send it to server. Also i guess that Client needs a thread that keeps listening for messages from server and update a TextArea when a massage its received. If user inputs, message its sended to server, and server resend it to ALL clients connected.

Any hints how I can do this best ? Some code will nice also because im new to this.
Question by:brightwood
    LVL 6

    Expert Comment

    About server, you can use a JMS server to implement it and use topic connection.
    You make an JMS endpoint to client can connect to this enpoint.
    LVL 14

    Accepted Solution

    LVL 35

    Expert Comment

    I think the best place to start is here: which is a step by step tutorial on how to write a client/server application in Java.
    LVL 3

    Expert Comment

    This has the example which might help
    LVL 35

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Suggested Solutions

    Title # Comments Views Activity
    Annotation to do Dependency injection in spring 3 30
    nested class vs inner class 5 36
    sumDigits  challenge 7 39
    endX challenge 2 31
    For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
    Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
    Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now