|
-
Feb 18th, 2000, 07:20 PM
#1
Thread Starter
New Member
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
-
Feb 20th, 2000, 11:33 AM
#2
Lively Member
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
-
Feb 21st, 2000, 02:35 AM
#3
Thread Starter
New Member
What does (Ubound) mean? thanks,
Dan
-
Feb 23rd, 2000, 09:40 AM
#4
New Member
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!
-
Feb 24th, 2000, 07:14 PM
#5
PowerPoster
Easier
If sckChat is your Winsock control you can use
sckChat.Count
That's the connection count as well.
-
Feb 24th, 2000, 11:36 PM
#6
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|