Results 1 to 6 of 6

Thread: Making my chat program multi user

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    14

    Post

    I have made a chat program, where a user connects to nother by entering their IP address and clicking on connect. so i have it working between two people, but how could i get it to allow unlimited users, with everyone receiving messages that everyone enters?

    so if the first user connects to the second, and the second to the third. the first and first should see eachother's messages also.

    i'd appreciate any help!!

    thanks,

    Dan

  2. #2
    Lively Member
    Join Date
    Nov 1999
    Location
    Melbourne, Victoria, Australia
    Posts
    126

    Post

    This can be done, with some sockets coding... Try some of the following example code...

    Rather than have everyone connect to everyone else and throw ports and sockets around, make one dedicated server that all users conected to...

    For x = 1 to SckChat(UBound)
    SckChat(x).SendData ChatMessageStr
    DoEvents 'Use this prevent buffer flooding, do NOT remove this.
    Next x

    That will send the text ChatMessageStr
    to all the users connected to your server.

    If you want some code on how to accept multiple connections on the same port, IE: have 10 users connected to your server on port 115 email me and i'll send you some code...

    Cheers!

    ------------------
    Regards,

    Paul Rivoli
    -------------------
    [email protected]
    http://users.bigpond.com/privoli

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    14

    Post

    What does (Ubound) mean? thanks,

    Dan

  4. #4
    New Member
    Join Date
    Feb 2000
    Location
    Chicago, IL, USA
    Posts
    9

    Post Multi User Chat...

    UBound is the total number of winsocks connected. Therefore, if you have 5 connections, UBound would equal 5. So the code above is sending the data to all 5 winsock controls.

    Hope this answers your question.
    If you want to be known, GET ON THE NET!

  5. #5
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088

    Post Easier

    If sckChat is your Winsock control you can use
    sckChat.Count
    That's the connection count as well.

  6. #6
    Junior Member
    Join Date
    Nov 1999
    Posts
    27

    Post

    I thought I would sneak this 'chat' related question in this thread:

    Anyone know of any chat client base code that will work against the IRC servers, like DALNET etc? I need a custom code version similiar to MIRC.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width