Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Project about Chat application with multi hop forwarding

  1. #1
    Junior Member
    Join Date
    Apr 2022
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Project about Chat application with multi hop forwarding

    Hey! I am making a chat application which uses multi hop forwarding. For this, I need each node to send their routing tables to their neighbours so thayt every reachable node can have one table with the destination ID, number of hops, and the next Hop to get to this destination as one entry in the table (Note: hops to your own ID is 0, to your immediate neighbour is 1). I tried to implement this by building an inital table using a hashmap, with the key as the destination ID and the value as an instance of a class I made, called Route. This class accesses number of hops and next hop ID. I initialize the table with the node's own ID as the only entry and broadcast it to my neighbours. They add my ID to their table with the number of hops being incremented by one. This all works fine, but many times, when I try to start 4 instances of the program, most nodes do not have a correct table. They usually have less than 4 entries which is wrong, all of them should have 4. Does anyone have any idea as to why this happens? (Note: I have implemeted collision avoidance too)

    Also, how could I broadcast a caht from one node to everyone in the system? The only idea I have is flooding the network but is there any other way? Can acknowlegements work in this method too?

    Thanks

  2. #2
    Member
    Join Date
    Apr 2022
    Posts
    36
    Thanks
    0
    Thanked 8 Times in 8 Posts

    Default Re: Project about Chat application with multi hop forwarding

    can i see you source code?

Similar Threads

  1. CHAT PROJECT
    By nikhit in forum What's Wrong With My Code?
    Replies: 21
    Last Post: June 25th, 2014, 01:56 PM
  2. How can i create a chat application
    By Celestine in forum Java Theory & Questions
    Replies: 7
    Last Post: July 28th, 2013, 12:34 PM
  3. Chat application
    By Celestine in forum What's Wrong With My Code?
    Replies: 1
    Last Post: July 27th, 2013, 12:22 PM
  4. [SOLVED] My chat program's multi threaded server keeps on throwing exceptions when calling nextLine();
    By Chromejuice in forum What's Wrong With My Code?
    Replies: 4
    Last Post: November 2nd, 2012, 10:52 PM
  5. Multi-Threaded Chat Server
    By TopdeK in forum What's Wrong With My Code?
    Replies: 5
    Last Post: May 7th, 2011, 10:12 AM

Tags for this Thread