Real-time Chat Window

February 19, 2011

QuickSilver Chat Window

QuickSilver Chat Window

There is now an operational Chat Window available from the desktop context menu.

To use the chat window, you must first “Open” the named channel (name is in textfield at bottom). You will then automatically receive any messages sent over that channel. To send a message, write the text in the bottom panel and press “Send”.

This is a very simple chat application that uses some new features in the Channel class.

1) when a channel is opened, it is assigned a unique ID number (from Math.random()). So, each browser will have a unique number for messages sent on the channel.

2) when messages are sent, they are packaged into an dictionary that contains the message id (above) and the message value. When messages are received, each Chat Window application checks the message id number against its own ID number. It uses this information to process only messages that were sent by other applications.

So, this chat application is sending and receiving objects. At the moment, the only data in the object is a string of text.

It is very easy to start including other info in the messages such as time, priority, classification, etc.

And the data doesn’t have to be a string – it could be a dictionary or an array for updating graphs or lists.

Chat Window provides a functional basis for a series of real-time work collaboration tools.


6 Responses to “Real-time Chat Window”

  1. Andy Burnett Says:

    I am really impressed by the performance if the channel API. updates were almost instaneous.

    I was hoping to experiment with the chat client on an iPad and iPhone, but SST doesnt seem to recognise the two finger tap on an iOS device. Do you think you could add a ‘world menu’ button to the transcript window – or anywhere else if it is easier, just so I can test it.

  2. Peter Fisk Says:

    I have added a “Menu” button to the Transcript. IIRC, the Sencha mobile library does recognize gestures.

    You should now be able to test it on the iPhone/iPad.

    ChannelAPI is very fast. Sometimes there is a latency due to Java VM cold starts. Once there are enough people using the network, I will upgrade the service for guaranteed warm starts.

  3. Andy Burnett Says:

    Brilliant, it works 🙂

  4. Andy Burnett Says:

    There seems to be a slight problem with the chat window. I haven’t quite nailed it down, but it seems to be that the first client to open the channel is able to send to all other clients, but doesn’t receive any messages sent from other clients. Feature if the current code, or bug?

  5. Peter Fisk Says:

    The behavior that I see is that clients do not see the messages that they originate but they do see messages sent by all other clients.

    That is what it is designed to do.

    However, I am sure that there are cases where something may go wrong.

    There should be checking done to make sure that the channels are properly opened.

    This week I will make the client side code available in the project. It is important to get the code working reliably.

    — Peter

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: