Results 1 to 3 of 3

Thread: Chat Room help

  1. #1
    Noelf21 is offline Member
    Join Date
    Dec 2009
    Rep Power

    Default Chat Room help

    I have made a chat room using with RMI in netbeans, I need to make multiple rooms however and was not sure how to do it. Would i be right to assume that you have to create a port on the server that runs the second room for you or is there a different way to do it?

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Rep Power


    I've never done this with RMI, but I have done this using simple sockets and object serialization.

    In my implementation, I kept all the 'rooms' on the server, and each client would communicated with the server and identify itself in each message. In this way, the server knew where to direct messages. That way, the server only needs to use the one port, and each client has its own socket.

    I would imagine that in using RMI, you could pass information about who is talking to whom as parameters ... But I don't know how an RMI implementation would keep track of its clients.

    In my app, it was IRC style and every message sent to the server was relayed to every client in the current room - so the server kept a list of sockets for each room. A single thread and server socket listened to messages from all clients and directed them from there.

  3. #3
    dinosoep is offline Senior Member
    Join Date
    Nov 2009
    Rep Power


    what mirc does is
    User room:message
    it redericts it to the users listening to that room
    pretty simple:)

Similar Threads

  1. Problem With Chat
    By Noelf21 in forum New To Java
    Replies: 1
    Last Post: 12-15-2009, 02:51 PM
  2. Chat application with RMI
    By dhaval.rajput.p in forum Advanced Java
    Replies: 0
    Last Post: 07-11-2009, 10:12 AM
  3. Chat tutorials
    By imperium2335 in forum Java Applets
    Replies: 1
    Last Post: 06-29-2009, 04:39 AM
  4. Replies: 3
    Last Post: 04-20-2009, 09:53 PM
  5. Replies: 1
    Last Post: 08-09-2008, 11:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts