Click here to Skip to main content
15,920,217 members
Home / Discussions / C#
   

C#

 
GeneralRe: Speech Compression for Voice Chat Pin
surfman1924-Jun-06 13:33
surfman1924-Jun-06 13:33 
GeneralRe: Speech Compression for Voice Chat Pin
Ed.Poore25-Jun-06 9:03
Ed.Poore25-Jun-06 9:03 
AnswerRe: Speech Compression for Voice Chat Pin
mav.northwind25-Jun-06 0:20
mav.northwind25-Jun-06 0:20 
Questionobject vs. text stream Pin
Ed 5424-Jun-06 10:40
Ed 5424-Jun-06 10:40 
AnswerRe: object vs. text stream Pin
Ed 5424-Jun-06 11:19
Ed 5424-Jun-06 11:19 
QuestionSMS Server Pin
mostafa_h24-Jun-06 10:36
mostafa_h24-Jun-06 10:36 
QuestionHow do you implement a message queuing system? Pin
Steve Messer24-Jun-06 10:25
Steve Messer24-Jun-06 10:25 
AnswerRe: How do you implement a message queuing system? Pin
Ed.Poore24-Jun-06 12:56
Ed.Poore24-Jun-06 12:56 
Rather than having IMessage implement the sending it'd probably be easier to let the plugin send the message since it should contain a reference to the "System" object.  If all Plugins derive from a base-class then you can implement a "SendMessage" function which will accept an IMessage and simply call a routine on the System object to add the message to it's internal Queue (you can use a Generic Queue or whatever for this).  So basically:
interface IMessage
{
    // Properties
}
abstract class Plugin
{
    System parent;
    virtual void SendMessage(IMessage message)
    {
        this.parent.OnMessage(message);
    }
}
Et voila, I know that you said all plug-ins implement a particular interface but might I suggest they instead derive from a base-class because then you can easily add stuff like the above to it.  If you were only providing an interface then the plugin writer would have to write the SendMessage function each time they write a plugin.

If you need to store the messages then I think there's a Queue Collection in the System.Collections and System.Collections.Generic namespaces (first is "weakly-typed", secondly can be generically typed to IMessage).



The Welsh will always support two teams: The Welsh, and anyone playing England Smile | :)
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer24-Jun-06 15:00
Steve Messer24-Jun-06 15:00 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford24-Jun-06 19:55
Leslie Sanford24-Jun-06 19:55 
GeneralRe: How do you implement a message queuing system? [modified] Pin
Steve Messer24-Jun-06 20:15
Steve Messer24-Jun-06 20:15 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford24-Jun-06 21:11
Leslie Sanford24-Jun-06 21:11 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 3:47
Steve Messer25-Jun-06 3:47 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford25-Jun-06 5:35
Leslie Sanford25-Jun-06 5:35 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 5:54
Steve Messer25-Jun-06 5:54 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford25-Jun-06 6:27
Leslie Sanford25-Jun-06 6:27 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 7:46
Steve Messer25-Jun-06 7:46 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford25-Jun-06 8:24
Leslie Sanford25-Jun-06 8:24 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 8:56
Steve Messer25-Jun-06 8:56 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford25-Jun-06 9:16
Leslie Sanford25-Jun-06 9:16 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 12:35
Steve Messer25-Jun-06 12:35 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford25-Jun-06 13:20
Leslie Sanford25-Jun-06 13:20 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 13:37
Steve Messer25-Jun-06 13:37 
GeneralRe: How do you implement a message queuing system? Pin
Leslie Sanford25-Jun-06 13:48
Leslie Sanford25-Jun-06 13:48 
GeneralRe: How do you implement a message queuing system? Pin
Steve Messer25-Jun-06 14:20
Steve Messer25-Jun-06 14:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.