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

  • SEARCH
  • Home
  • 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 8532979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:50:43+00:00 2026-06-11T09:50:43+00:00

I am developing an auction system on top of Netty. I use Netty because

  • 0

I am developing an auction system on top of Netty.
I use Netty because googling has taught me that NIO can deal with much larger clients than ordinary socket programming can.

Basically I am a starter in Netty. I have covered the tutorials and user guide. And that is it.
So plz understand if my question doesn’t qualify as a “problem”.
The following is the pseudo-code of my client.

public class AuctionClient
{
    private boolean loggedIn;

    public AuctionClient() //constructor

    ///
    .... // various functions
    ///

    public void run()
    {
        while (true)
        {
            int option = getUserOption(); //get user menu selection

            switch(option)
            {
                case 1:
                    login(); //user enters username and password. The info is converted into JSON string and sent to AuctionServer. 
                             //AuctionServer returns true if the info is correct, false otherwise
                    break;

                case 2:
                    startAuction(); //start a new auction
                    break;

                case 3:
                    makeBid(); //make a bid to an existing auction
                    break;

                case 4:
                    logout(); //log out from the AuctionServer
                    break;

                default:
                    break;
            }
        }
    }

    public static void main() // Creates AuctionClient class and runs it.
}

This is the gist of what I am trying to do.
The problem is, I want to enable startAuction(), makeBid(), and logout() only if the variable loggedIn is true. So I have to know if the login was successful in order to change the value of loggedIn.

But since it is the AuctionClientHandler(though now shown here) that deals with the result of login(), there is no way for AuctionClient to know if the login was successful.

Is there a graceful way to solve this problem. I want to avoid using BlockingQueue to pass information between AuctionClient and AuctionClientHandler. Or is there a better design for the auction system?

Any help would be appreciated.

Edward

  • 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-11T09:50:45+00:00Added an answer on June 11, 2026 at 9:50 am

    I think your problem can be boiled down to a simple fact. You need to hold “state” from a previous operation. For this need to create a new handler each time in your PipelineFactory implementation. For e.g. pipeline.addLast('MyAuctionHandler',new AuctionHandlerClass());
    The first time login happens successfully your LoginHandler which is in the pipeline should send a message to the AuctionClientHandler say a special object, which you can then use to set the login flag to true.
    For example code, you might want to take a look at a Java Game Server I have published. It also deals with similar login, session management etc. This is the handler which deals with login, only difference is that this handler is not stateful, since I moved the state to a session LookupService class.

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

Sidebar

Related Questions

Here is my problem: I'm developing a system that can be polled to retrieve
I am currently developing an online Auction system using ASP.NET 3.5 and SQLServer 2008.
I am developing a system with Symfony which has a notification module integrated into
I am developing a system, where each user can send personal messages to other
I'm developing a canvas graphical editor. I have already coded an undo-redo system that
I am developing an Auction site in asp.net3.5 and sql server 2008R2, My Database
I am developing a simple page action extension in google chrome and it has
I'm developing a simple Android application that would have an action bar on the
Developing for Android 2.3, I have a question regarding layouts. I use a vertival
Iam developing one application.In that iam placing the radio buttons(uiimageview) on table view and

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.