Thread: Socket Project (getting one of multiple clients IP)

  1. #1
    Cl0wn
    Guest

    Socket Project (getting one of multiple clients IP)

    I am making a project for my computer science class. I need to create a multiuser chat program where a user on logon will recieve a request form the server asking for a user name. The server will get the clients username and its IP address. I am stuck on how to get that person's IP address when he begins to enter his message. I know of the inet_ntoa() function but I am not sure how to specify the correct user. The end result upon all the clients screens will be something of the sort:
    "wake nate05: what about you?
    Rav8Warriors5enS: chillin
    Rav8Warriors5enS: bout to do some weightliftin and then study
    wake nate05: cool"

    Any help is appreciated.

  2. #2
    Registered User
    Join Date
    Jan 2003
    Posts
    99
    Well I don't know how to do threads, secondly can you not get the IP where activity is taking place?

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    99
    Ahh that works nicely and thanks for that example on threads. Now I just have to get it to work on good ol Windows .

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting Ip from socket.
    By b00l34n in forum Networking/Device Communication
    Replies: 32
    Last Post: 10-19-2004, 02:31 AM
  2. Including multiple .cpp file in project
    By bonkey in forum C++ Programming
    Replies: 2
    Last Post: 11-04-2002, 08:41 AM
  3. Multiple Clients Winsock
    By PrivatePanic in forum Windows Programming
    Replies: 6
    Last Post: 07-26-2002, 06:38 AM
  4. Replies: 2
    Last Post: 03-05-2002, 05:52 AM
  5. server with multiple clients
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 02-23-2002, 09:15 PM