|
-
Jan 22nd, 2000, 10:24 PM
#1
Thread Starter
PowerPoster
Hi,
I'm trying to do a chat application and I've got a problem with sending messages. That's what happens:
A user writes something and sends it to the server. Then the server (should) sends it to the other users, see code:
-
For A = 0 to WS.Count - 1
If WS(A).State = sckConnected then
WS(A).SendData iText
EndIf
Next
-
Well, what really happens is that only the last WS sends the text.
I also know that if you send every second one string that it works... But it should be FAST.
------------------
[email protected]
...
Every program can be reduced to one instruction which doesn't work.
-
Jan 23rd, 2000, 07:57 AM
#2
New Member
add this and see if it works mate:
For A = 0 to WS.Count - 1
If WS(A).State = sckConnected then
WS(A).SendData iText
DoEvents 'this makes it complete events
' first
EndIf
Next
if it dont work, then ya will have to supply mo' data kuz i am in the dark buddy.
<-- dephcon
------------------
"Fate is but an outline, we must fill in the rest."
-
Jan 23rd, 2000, 06:51 PM
#3
Thread Starter
PowerPoster
Thanks, but the mistake was that I had to wait for the SendComplete event of the Winsock.
Thanks anyway!
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
|