Results 1 to 3 of 3

Thread: Chat Room help

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

    Default Chat Room help

    Hi,
    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?
    Cheers,
    Noel

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    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
    Posts
    150
    Rep Power
    6

    Default

    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, 03:51 PM
  2. Chat application with RMI
    By dhaval.rajput.p in forum Advanced Java
    Replies: 0
    Last Post: 07-11-2009, 11:12 AM
  3. Chat tutorials
    By imperium2335 in forum Java Applets
    Replies: 1
    Last Post: 06-29-2009, 05:39 AM
  4. Replies: 3
    Last Post: 04-20-2009, 10:53 PM
  5. Replies: 1
    Last Post: 08-09-2008, 12:55 PM

Posting Permissions

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