EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Chat community - How to design it properly?

Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.
#25230
Posted: 06/08/2013 09:09:43
by Andrea Raimondi (Basic support level)
Joined: 06/08/2013
Posts: 2

Hello!

I have started studying MsgConnect.
What I want to obtain is a chat community(both video and text) and I think MsgConnect can help me to obtain this result. Yes, I know that live webcam streaming isn't supported :) I have another component for that.
My main issue is designing the whole thing in a way that:
- Makes the use of the library easy for the result I want
- Makes sense in general as an architecture.

From what I've learned of the library so far, it seems to me I have many actors:

- The general server
- Several chatroom servers(1 per room)
- User clients

Now let's get to talk about 1 per each, so that things are slightly easier:

It seems to me that we really have several connection points, i.e. the server should just be considered another peer instead of being a "server" communication-wise. It only becomes a server by means of its
function. Is that correct?

Also, each user must really have three queues: one for the incoming messages, one for outgoing ones and one for each chatroom I would like the user to be in at any one time. This could be reduced to one queue for all chatrooms with some clever trick, which you can probably suggest.

Further to this, I need to understand the best way to go about the various private chats, i.e. 1 on 1 conversations. These could be handled directly as P2P but I am not sure it's the right way: the idea here could be to use the server component as a sort of DNS which resolves a user name to an address.
Do we have ways to do this properly? Maybe with an article list? I am not sure, which is why I am asking.

Oh and last but not least, it seems to me that the messages are number-based
instead of string-based. This isn't very clever as I then need a list of
numbers to associate to the messages, unless I decide to create the list
dynamically and have some sort of hashing that translates the strings into
numbers, which is not ideal.

Am I talking sense here? Am I missing anything?

Can you please help solve the riddles?

Thank you very much,

A
#25231
Posted: 06/08/2013 09:22:19
by Eugene Mayevski (EldoS Corp.)

First thing to mention is that MsgConnect is mainly a transport, i.e. it doesn't enforce design patterns and doesn't impose restrictions on your design.

Quote
Andrea Raimondi wrote:
It seems to me that we really have several connection points, i.e. the server should just be considered another peer instead of being a "server" communication-wise. It only becomes a server by means of its function. Is that correct?


As you like, really. On transport level it's wiser (for your task) to keep functions separated (i.e. have InetTransport in Server and Client modes rather than P2P).

Quote
Andrea Raimondi wrote:
Also, each user must really have three queues: one for the incoming messages, one for outgoing ones and one for each chatroom I would like the user to be in at any one time. This could be reduced to one queue for all chatrooms with some clever trick, which you can probably suggest.


Several approaches are possible. First is to have one incoming queue (there's no need for outgoing queues in MsgConnect) for all chatrooms and server messages. Then you distinguish rooms and service messages by message codes.
Alternatively you can have a service queue and one common chatroom queue. Finally, you can separate chatroom queues by room names (IDs).

Quote
Andrea Raimondi wrote:
Further to this, I need to understand the best way to go about the various private chats, i.e. 1 on 1 conversations. These could be handled directly as P2P but I am not sure it's the right way: the idea here could be to use the server component as a sort of DNS which resolves a user name to an address.


Yes, with firewalls, NATs and routers P2P in global network (in opposite to LAN) becomes overcomplicated. So the server is welcome.

Quote
Andrea Raimondi wrote:
Do we have ways to do this properly? Maybe with an article list? I am not sure, which is why I am asking.


There are several articles present on https://www.eldos.com/msgconnect/articles/60-179.php

Quote
Andrea Raimondi wrote:
Oh and last but not least, it seems to me that the messages are number-based instead of string-based.


The message has a code, two integer parameters and a binary data block for your data. Message code and integer parameters are more than enough for filtering messages, and actual data (message text in your case) goes in a data block. If you need to serialize the complex data, you can use MCDataTree class.


Sincerely yours
Eugene Mayevski
#25232
Posted: 06/08/2013 10:33:05
by Andrea Raimondi (Basic support level)
Joined: 06/08/2013
Posts: 2

Hello again!

Quote

Quote
Andrea Raimondi wrote:
It seems to me that we really have several connection points, i.e. the server should just be considered another peer instead of being a "server" communication-wise. It only becomes a server by means of its function. Is that correct?

Eugene Mayevski wrote:
As you like, really. On transport level it's wiser (for your task) to keep functions separated (i.e. have InetTransport in Server and Client modes rather than P2P).


I need a best practice here, I think.
My idea would be along the lines of:

SERVER
------
Classes: Transport+Message+Queue
Use: - Accepts incoming messages for other users,
- Sends out a list of registered rooms,
- Acts as a DNS for room IPs
The above is an example, feel free to integrate as you think appropriate.

Quote

Quote
Andrea Raimondi wrote:
Also, each user must really have three queues: one for the incoming messages, one for outgoing ones and one for each chatroom I would like the user to be in at any one time. This could be reduced to one queue for all chatrooms with some clever trick, which you can probably suggest.
Eugene Mayevski wrote:
Several approaches are possible. First is to have one incoming queue (there's no need for outgoing queues in MsgConnect) for all chatrooms and server messages. Then you distinguish rooms and service messages by message codes.
Alternatively you can have a service queue and one common chatroom queue. Finally, you can separate chatroom queues by room names (IDs).

Again, I need a best practice approach.
One of the articles suggests that an article on how to create an Instant Messenger will be authored but, from what I skimmed, I can't find any
article on that. Is it still in the works? Is it still being planned?
What is the status of that?
If such an article were available, alongside a basic application,
this would help me enormously. Please tell me it's still on the plan :)

Quote
Eugene Mayevski wrote:
The message has a code, two integer parameters and a binary data block for your data. Message code and integer parameters are more than enough for filtering messages, and actual data (message text in your case) goes in a data block. If you need to serialize the complex data, you can use MCDataTree class.


I can't see a component of that name. Is it a non-component class?
Ideally, I would like to send/receive structured messages, therefore I will
give that class a look.

Thank you!

A
#25233
Posted: 06/08/2013 10:46:36
by Eugene Mayevski (EldoS Corp.)

Quote
Andrea Raimondi wrote:
I can't see a component of that name. Is it a non-component class?


Yes, this is not a component but a class.


Sincerely yours
Eugene Mayevski

Reply

Statistics

Topic viewed 4822 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!