Thread: Console App w/ Threads and Events?

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912

    Console App w/ Threads and Events?

    This is the first program I've written that uses threads, so I'm a tad inexperienced at that aspect, but it is by no means my first console app, so no problem there!

    It is, once again, my server program, and sets up one thread to listen for requests, and then creates a new thread for each request (although setting a limit to the number of connection at once). My user will exectue the program, bringing up a menu to do a number of tasks, and once they select the option for the server to taking requests, it will just be running this system of threads. I was to set up an event handler, so that the user can push a certain button to start removing the server from activity.

    I'm using a console app to allow for multi-platform functionality (at least under implementations of .NET such as Mono).
    I know the big advantage to a using GUI is being event-centric, but in a console app, do event handlers still work? Any tips for doing things in this manner?

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Event Handlers still work. There is no change in functionality when you run a console application, just different input/output.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. automatic parallelizing of 2 threads in a dual core ??
    By mynickmynick in forum C Programming
    Replies: 4
    Last Post: 07-24-2008, 10:03 AM
  2. CreateThread ?!
    By Devil Panther in forum Windows Programming
    Replies: 13
    Last Post: 11-15-2005, 10:55 AM
  3. problem with win32 threads
    By pdmarshall in forum C++ Programming
    Replies: 6
    Last Post: 07-29-2004, 02:39 PM