Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8206271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:36:45+00:00 2026-06-07T08:36:45+00:00

I am making an IM chat client and need to use one randomly generated

  • 0

I am making an IM chat client and need to use one randomly generated session ID for 3 classes but can’t get it to work. When I try to pass it from one to the other it just makes a new one. The idea is that classA runs the chat and creates a new folder named after the sessionID, and saves the chatLog there. classB opens the folder (which is why it needs to know the sessionID) and runs methods on the data within the folder. Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T08:36:46+00:00Added an answer on June 7, 2026 at 8:36 am

    Make the sessionID a class of it’s own.

    In constructor of class A

    then when you go to call class B, add it in the constructor

    B item = new B(id);
    

    for B

    sessionID session;
    Public B (SessionID myid)
    {
        session = myid;
        // add extra code
    }
    

    then use session as your session id.

    Edit:

    class A
    {
        public A ()
        {
            sessionID id = new sessionID();
        }
    Thread mychat = new B(id);
    mychat.start();
    }
    
    class B extends Thread  
    {
        // make constructor
        Public B (SessionID myid)
        {
                session = myid;
        }
        // This method is called when the thread runs
        public void run() 
        {
            //working code
        }
    }
    

    I cannot make it any clearer then that.. sorry if you still don’t understand it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a chat similar to the Facebook's or Gmail's one, but something is
I'm making a small chat application. I got to the point where one client
Alright, so I'm making a Facebook-style chat. But that doesn't really matter. See here:
im making a Server-Client application.. chat sends commands file-transfer i was wondering if it
I'm making a chat script using jQuery and JSON, but my hosting suspends it
I'm making a simple client server chat application. I want to be able to
I'm making an IRC client where the chat is displayed in a multi-line TextBox
I am making a facebook-like chat system so the users of my system can
I'm interested in making an in-company encrypted peer-to-peer chat app in Cocoa, but I
I'm making a chat program, and I need a place to store messages. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.