Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Chat Application

Chat Application

Scheduled Pinned Locked Moved C#
sysadminhelpquestionloungelearning
22 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Kevin Marois

    I want to create a simple chat app. I would like to host it on my server and allow one-to-many people to chat. I'd like to do it myself as a learning experience. Can anyone point me in the right direction? Thank you

    If it's not broken, fix it until it is

    R Offline
    R Offline
    Ravi Bhavnani
    wrote on last edited by
    #2

    Lots of examples here[^]. /ravi

    My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

    K 1 Reply Last reply
    0
    • R Ravi Bhavnani

      Lots of examples here[^]. /ravi

      My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

      K Offline
      K Offline
      Kevin Marois
      wrote on last edited by
      #3

      LOL - Never thought to look here DOH!

      If it's not broken, fix it until it is

      R 1 Reply Last reply
      0
      • K Kevin Marois

        LOL - Never thought to look here DOH!

        If it's not broken, fix it until it is

        R Offline
        R Offline
        Ravi Bhavnani
        wrote on last edited by
        #4

        What kind of app are you looking to build - web or desktop?  I favor desktop, which relieves one of having to deal with the intricacies of building an async web UI, but your needs may vary. /ravi

        My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

        K 2 Replies Last reply
        0
        • R Ravi Bhavnani

          What kind of app are you looking to build - web or desktop?  I favor desktop, which relieves one of having to deal with the intricacies of building an async web UI, but your needs may vary. /ravi

          My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

          K Offline
          K Offline
          Kevin Marois
          wrote on last edited by
          #5

          I'd build the UI with WPF and host the server on my server.

          If it's not broken, fix it until it is

          1 Reply Last reply
          0
          • R Ravi Bhavnani

            What kind of app are you looking to build - web or desktop?  I favor desktop, which relieves one of having to deal with the intricacies of building an async web UI, but your needs may vary. /ravi

            My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

            K Offline
            K Offline
            Kevin Marois
            wrote on last edited by
            #6

            You know, I'm fairly good with MVC 4 Web Services. Any reason I shouldn't use that?

            If it's not broken, fix it until it is

            R P 2 Replies Last reply
            0
            • K Kevin Marois

              You know, I'm fairly good with MVC 4 Web Services. Any reason I shouldn't use that?

              If it's not broken, fix it until it is

              R Offline
              R Offline
              Ravi Bhavnani
              wrote on last edited by
              #7

              No, I think that's a good idea.  If your server talks JSON, you could also use it with native mobile clients. /ravi

              My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

              K 1 Reply Last reply
              0
              • R Ravi Bhavnani

                No, I think that's a good idea.  If your server talks JSON, you could also use it with native mobile clients. /ravi

                My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

                K Offline
                K Offline
                Kevin Marois
                wrote on last edited by
                #8

                Agreed. And it should be fairly simple.

                If it's not broken, fix it until it is

                R 1 Reply Last reply
                0
                • K Kevin Marois

                  Agreed. And it should be fairly simple.

                  If it's not broken, fix it until it is

                  R Offline
                  R Offline
                  Ravi Bhavnani
                  wrote on last edited by
                  #9

                  Have you considered using a Jabber server instead of writing one from scratch? /ravi

                  My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

                  1 Reply Last reply
                  0
                  • K Kevin Marois

                    I want to create a simple chat app. I would like to host it on my server and allow one-to-many people to chat. I'd like to do it myself as a learning experience. Can anyone point me in the right direction? Thank you

                    If it's not broken, fix it until it is

                    P Offline
                    P Offline
                    PIEBALDconsult
                    wrote on last edited by
                    #10

                    Several years ago I wrote one that was just WinForms-to-SQL-Server, then I started working on a WCF service for it (again, it was quite a while ago), but since then it has stagnated. It's something I'd like to finish for an article. Calling it a "chat app" isn't terribly accurate, as it is something between that and a simple e-mail system. It supports message threads (like forum posts here on CP) and delayed delivery for recipient(s) who are offline.

                    Kevin Marois wrote:

                    as a learning experience

                    Should be a good way to learn the communication framework du jour and allow clients to be created for a number of devices.

                    K 1 Reply Last reply
                    0
                    • P PIEBALDconsult

                      Several years ago I wrote one that was just WinForms-to-SQL-Server, then I started working on a WCF service for it (again, it was quite a while ago), but since then it has stagnated. It's something I'd like to finish for an article. Calling it a "chat app" isn't terribly accurate, as it is something between that and a simple e-mail system. It supports message threads (like forum posts here on CP) and delayed delivery for recipient(s) who are offline.

                      Kevin Marois wrote:

                      as a learning experience

                      Should be a good way to learn the communication framework du jour and allow clients to be created for a number of devices.

                      K Offline
                      K Offline
                      Kevin Marois
                      wrote on last edited by
                      #11

                      I'm thinking I could create a Web API that maintains a list of Conversations. Each Conversation would have a unique Id and a list of Participants. The only problem I see is the API notifying clients that they have a message. I'm guessing a callback of some sort would do the trick.

                      If it's not broken, fix it until it is

                      P 1 Reply Last reply
                      0
                      • K Kevin Marois

                        I want to create a simple chat app. I would like to host it on my server and allow one-to-many people to chat. I'd like to do it myself as a learning experience. Can anyone point me in the right direction? Thank you

                        If it's not broken, fix it until it is

                        R Offline
                        R Offline
                        raju melveetilpurayil
                        wrote on last edited by
                        #12

                        SignalR will be a better component for a chat application. I done a real-time time application with SignalR.. Its very interesting :cool:

                        K 1 Reply Last reply
                        0
                        • R raju melveetilpurayil

                          SignalR will be a better component for a chat application. I done a real-time time application with SignalR.. Its very interesting :cool:

                          K Offline
                          K Offline
                          Kevin Marois
                          wrote on last edited by
                          #13

                          Except is seems to be designed around ASP.Net. My usage will NOT be asp.Net

                          If it's not broken, fix it until it is

                          R 1 Reply Last reply
                          0
                          • K Kevin Marois

                            Except is seems to be designed around ASP.Net. My usage will NOT be asp.Net

                            If it's not broken, fix it until it is

                            R Offline
                            R Offline
                            raju melveetilpurayil
                            wrote on last edited by
                            #14

                            Kevin Marois wrote:

                            My usage will NOT be asp.Net

                            So what language are you going to use?:~

                            K 1 Reply Last reply
                            0
                            • R raju melveetilpurayil

                              Kevin Marois wrote:

                              My usage will NOT be asp.Net

                              So what language are you going to use?:~

                              K Offline
                              K Offline
                              Kevin Marois
                              wrote on last edited by
                              #15

                              Language? C# ASP.Net is not a language. It's a Web Development platform

                              If it's not broken, fix it until it is

                              R 1 Reply Last reply
                              0
                              • K Kevin Marois

                                Language? C# ASP.Net is not a language. It's a Web Development platform

                                If it's not broken, fix it until it is

                                R Offline
                                R Offline
                                raju melveetilpurayil
                                wrote on last edited by
                                #16

                                my bad.. forgot the forum title :( .. thought about PHP and Java .. apologies

                                1 Reply Last reply
                                0
                                • K Kevin Marois

                                  I'm thinking I could create a Web API that maintains a list of Conversations. Each Conversation would have a unique Id and a list of Participants. The only problem I see is the API notifying clients that they have a message. I'm guessing a callback of some sort would do the trick.

                                  If it's not broken, fix it until it is

                                  P Offline
                                  P Offline
                                  PIEBALDconsult
                                  wrote on last edited by
                                  #17

                                  Kevin Marois wrote:

                                  Each Conversation would have a unique Id and a list of Participants.

                                  I put it in a database. Each message has its own ID, the ID of its parent, and the ID of the first message in the thread. Each message also has its own set of recipients (many-to-many relationship between Message and User). The client could then display each message as it arrives, or show the entire thread in a TreeView.

                                  Kevin Marois wrote:

                                  API notifying clients

                                  "Push" sucks; always has, always will. I always use polling; it allows the client/user to control frequency or even disable polling altogether. I also put in a "get messages now" feature. The server should only handle requests as they are made and not try to keep track of all the possible connections or it won't scale well. You probably also don't want to waste cycles re-trying broadcasts to clients that have lost connectivity. If no one is asking for data, don't try to send it; just wait.

                                  K 1 Reply Last reply
                                  0
                                  • K Kevin Marois

                                    You know, I'm fairly good with MVC 4 Web Services. Any reason I shouldn't use that?

                                    If it's not broken, fix it until it is

                                    P Offline
                                    P Offline
                                    PIEBALDconsult
                                    wrote on last edited by
                                    #18

                                    Kevin Marois wrote:

                                    I'm fairly good with MVC 4 Web Services

                                    Then it might be a good opportunity to teach rather than learn. :-D

                                    K 1 Reply Last reply
                                    0
                                    • P PIEBALDconsult

                                      Kevin Marois wrote:

                                      I'm fairly good with MVC 4 Web Services

                                      Then it might be a good opportunity to teach rather than learn. :-D

                                      K Offline
                                      K Offline
                                      Kevin Marois
                                      wrote on last edited by
                                      #19

                                      The part I'm not sure about is getting notifications in the client from the Server. Ever done this?

                                      If it's not broken, fix it until it is

                                      P 1 Reply Last reply
                                      0
                                      • K Kevin Marois

                                        The part I'm not sure about is getting notifications in the client from the Server. Ever done this?

                                        If it's not broken, fix it until it is

                                        P Offline
                                        P Offline
                                        PIEBALDconsult
                                        wrote on last edited by
                                        #20

                                        Details. Details. Don't bother me with details. (I don't even know what MVC 4 is.)

                                        1 Reply Last reply
                                        0
                                        • P PIEBALDconsult

                                          Kevin Marois wrote:

                                          Each Conversation would have a unique Id and a list of Participants.

                                          I put it in a database. Each message has its own ID, the ID of its parent, and the ID of the first message in the thread. Each message also has its own set of recipients (many-to-many relationship between Message and User). The client could then display each message as it arrives, or show the entire thread in a TreeView.

                                          Kevin Marois wrote:

                                          API notifying clients

                                          "Push" sucks; always has, always will. I always use polling; it allows the client/user to control frequency or even disable polling altogether. I also put in a "get messages now" feature. The server should only handle requests as they are made and not try to keep track of all the possible connections or it won't scale well. You probably also don't want to waste cycles re-trying broadcasts to clients that have lost connectivity. If no one is asking for data, don't try to send it; just wait.

                                          K Offline
                                          K Offline
                                          Kevin Marois
                                          wrote on last edited by
                                          #21

                                          Ok but with polling the client would have to make queries every 2 or 3 seconds to get close to real time

                                          If it's not broken, fix it until it is

                                          P 1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups