Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 23rd, 2007, 03:24 AM
Authorized User
 
Join Date: Sep 2007
Location: , , .
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Which Thread to use and How

Hi,
I'd be really thankful if you review following architecture and let me know how to run each channel in one thread and which thread is proper for this:
I'm developing a chat application in which there are many rooms (referred to channel in code).

Code:
public class ChannelEngine : IChannelEngine
    {
....
public bool AddChannel(string channelname)
        {//is called, through server.aspx, for creating each room
            lock( syncRoot )
                if( !ChannelExists( channelname ) )
                {
                    if (Channels.Count >= Global.MaxRoomNum)
                    {
                        return false;
                    }

                    // Create Chat Engine for new channel
                    ChatEngine.ChatEngine channel = 
                        new ChatEngine.ChatEngine();                   

                    Channels.Add( channelname, channel);
                }
            return true;
        }
}
public class ChatEngine : IChatEngine
{
//this class contains a few functions that are called from client code every other second
}
The problem is that when users are in the same room they can chat without any problem but when one user switches to another room, the users in previous room cannot send/rec. text because those functions in ChatEngine are run completely only for the new room! I thought putting each room in one thread could help but I don't know how?

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Thread was being aborted acko ASP.NET 1.0 and 1.1 Basics 15 March 26th, 2014 02:52 AM
a Thread argument beccali Java Basics 1 February 21st, 2007 05:12 AM
Thread was being aborted sohailmaroof ASP.NET 1.0 and 1.1 Basics 2 January 13th, 2007 01:25 AM
communiation between thread gunx Pro VB 6 3 May 10th, 2005 03:56 PM
Thread portability rax Linux 0 September 3rd, 2004 06:54 AM



All times are GMT -4. The time now is 01:21 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.