|
-
Oct 14th, 2005, 04:54 AM
#1
Thread Starter
Fanatic Member
connect receiver when need to send message!!
i got one chat system, when i want send message to receiver, i will start connect to the receiver side...after connected and send out first message, when i want send the message, i connect again to the receiver side and this time i couldnt done job because occur some error.....i know that is bcoz of i connect another time...but i want maintain my idea and everytime i want send message then i connect to receiver side....how to solve this problem?
in receiver side, everytime it receive message, it will disconnect the connection and listen connection again....this idea is it not workable?
Last edited by kenny_oh; Oct 20th, 2005 at 09:01 AM.
-
Oct 20th, 2005, 03:37 AM
#2
New Member
Re: connect receiver when need to send message!!
As I understand u must be probably using TCP protocol from the WinSock OCX...
I did the same thing once... But the problem is, it takes a little while to make the connection to the destination....
So I suggest u try the following code...
VB Code:
Do Until sck_Connection.State = sckConnected ' sck_Connection is the name of the WinSock control in your Project
DoEvents
Loop
and after the loop terminates try sending ur Message...
Also make sure to terminate the connection from the sender side after the message is sent...
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
|