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. Client And Server Chat

Client And Server Chat

Scheduled Pinned Locked Moved C#
questionsysadminlounge
5 Posts 2 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.
  • T Offline
    T Offline
    tamir901
    wrote on last edited by
    #1

    Hello, I've built a chat that few clients can connect to the server and every message that each client send all the other recieve it. I want to add all the user name to each client when a new client is connect. How can i do it? i'm using the Hashtable class to store the users. thanks...

    P 1 Reply Last reply
    0
    • T tamir901

      Hello, I've built a chat that few clients can connect to the server and every message that each client send all the other recieve it. I want to add all the user name to each client when a new client is connect. How can i do it? i'm using the Hashtable class to store the users. thanks...

      P Offline
      P Offline
      PandemoniumPasha
      wrote on last edited by
      #2

      if you've done all that then it should not be hard to do what you want. the logic is the same. where exactly are you stuck?

      regards :)

      T 1 Reply Last reply
      0
      • P PandemoniumPasha

        if you've done all that then it should not be hard to do what you want. the logic is the same. where exactly are you stuck?

        regards :)

        T Offline
        T Offline
        tamir901
        wrote on last edited by
        #3

        How to remove from the other clients the users (from the list box). The massege i sent with StreamWriter (run on all the tcpClient array) to all the connetced clients. But somehow i have problem doing it... :(

        P 1 Reply Last reply
        0
        • T tamir901

          How to remove from the other clients the users (from the list box). The massege i sent with StreamWriter (run on all the tcpClient array) to all the connetced clients. But somehow i have problem doing it... :(

          P Offline
          P Offline
          PandemoniumPasha
          wrote on last edited by
          #4

          from what i understand, every message a client sends goes to the server which then broadcasts to all the clients. is that correct? if so, then the server will receive all the notifications regarding users logging in and logging out. it is just a matter of sending a control message to all the clients and notifying them of the changes that occurred. for that you need to design your own protocol and decide how you would like to handle server-client communication. if you have reached as far as broadcasting the messages to all clients, i presume that you have implemented some sort of protocol for the communication. now, all you have to do is extend it to include some server messages or commands that are handled by the client.

          regards :)

          T 1 Reply Last reply
          0
          • P PandemoniumPasha

            from what i understand, every message a client sends goes to the server which then broadcasts to all the clients. is that correct? if so, then the server will receive all the notifications regarding users logging in and logging out. it is just a matter of sending a control message to all the clients and notifying them of the changes that occurred. for that you need to design your own protocol and decide how you would like to handle server-client communication. if you have reached as far as broadcasting the messages to all clients, i presume that you have implemented some sort of protocol for the communication. now, all you have to do is extend it to include some server messages or commands that are handled by the client.

            regards :)

            T Offline
            T Offline
            tamir901
            wrote on last edited by
            #5

            OK, thanks...

            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