Chat with many chatrooms in WCF RRS feed

  • Question

  • Hello!

    I'm new in .NET, so I really need help.

    I'm trying to do a chat with VB .NET and WCF. At this moment , I have a channel, with a single endpoint in a app.config file. The different users are connecting to this channel. I need to do a chat with many chatrooms. When a user logs in, the application has to detect the corresponding chatroom. The user could see only in this chatroom.
    I'm using nettcp binding
    My doubts are:

    1) could I assign  a name or uid to channel

    2) could I dynamically create endpoints  or how simulate chatrooms?

    3) how can i connect a user to a specific channel?

    Perhaps my questions are silly, but I'm really lost.

    Thanks in advance.

    Tuesday, December 10, 2013 7:29 PM


  • You can use either Native ASP.Net approach or Silverlight approach to develop the good looking chat application.

    The only concern is how your application is responsive to the end user. Here responsive means how the system let the user to feel the presense of other users and real time chat experience. This is refrenced sometime  as really real time. (Like gmail & facebook webchat allows the user to see the user presense saying "user is typing or idle")

    You can achive this level of realtime appearance using both these technologies. But implementation are little different.

    In order to achive this, you must implement a duplex communication between the browser and server. So  then server will notify the client if there is any response from other user or his presense.

    In ASP.Net way:

    • This is been completely controlled by AJAX.
    • You have to simulate the Duplex communication using AJAX. By default HTTP doesnt support duplex. Its oneway. It only responses to client request. It cant directly invoke client method .
    • There are existing techniques available to achive this. One of the approach is called COMET or ReverseAJAX.
    • Its nothing but the long living AJAX calls, and will respond to the client if there is a expected event happening in server side, otherwise it stays calm. This Comet (programming)  wikipedia article explains more about the approach.

    In SilverLight way:

    • Silverlight gives much better User experience compared to normal HTML pages.
    • By using SL, you can make  use of WCF Duplex services to implement the server push technique. As per MSDN, it says

    A duplex service contract is a message  exchange pattern in which both  endpoints can send messages to the  other independently. A duplex service,  therefore, can send messages back to  the client endpoint, providing  event-like behavior

    Hope this helps

    Monday, December 16, 2013 10:18 AM