Location: Asia Pacific, Cyberspace, in the Dark Dystopia
Posts: 19,118
Thanks Given: 2,351
Thanked 3,359 Times in 1,878 Posts
Internet chat provides an interesting application for learning about the JMS pub/sub messaging model. Used mostly for entertainment, web-based chat applications can be found on thousands of web sites. In a chat application, people join virtual chat rooms where they can "chat" with a group of other people.
To illustrate how JMS works, we will use the JMS pub/sub API to build a simple chat application. The requirements of Internet chat map neatly onto the publish-and-subscribe messaging model. In this model, a producer can send a message to many consumers by delivering the message to a single topic. A message producer is also called a publisher and a message consumer is also called a subscriber. In reality, using JMS for a chat application would be overkill, since chat systems don't require enterprise quality service.
Here is an example application to help you get started:
Quote:
The following source code is a JMS-based chat client. Every participant in a chat session uses this Chat program to join a specific chat room (topic), and deliver and receive messages to and from that room:
Hello All,
I am a learner in C++. I was testing my inheritance knowledge with following piece of code.
#include <iostream>
using namespace std;
class base
{
public :
void display()
{
cout << "In base display()" << endl;
}
void display(int k)
{... (2 Replies)
I have the two class definition as follows.
class A { public: int a; };
class B : virtual public A{ };
The size of class A is shown as 4, and size of class B is shown as 16. Why is this effect ?. (2 Replies)
Hi all!
I am trying to register a device in an existing device class, but I am
having trouble getting the pointer to an existing class.
I can create a class in a module, get the pointer to it and then use
it to register the device with:
*cl = class_create(THIS_MODULE, className);... (0 Replies)
Hi,
I believe the next code is wrong:
class Egg {
Egg e;
int i;
Egg(int ii=0) : i(ii) {}
};
because you would end up with an endless definition (memory allocation) of Egg objects, thus int i.
Ok, so God Eckel proposes for a singleton:
class Egg {
static Egg e;
int... (5 Replies)
Hi, i have a question about C++. Is it possible to declare a class with a member ot the same class? For example, a linked list or i want to convert this C code to C++ class (Elemento)
typedef struct elemento
{
char name;
char value;
List<struct elemento> ltElementos;
... (7 Replies)