|
-
Nov 26th, 2000, 09:43 AM
#1
Thread Starter
New Member
Hi,
Anyone know how to test to see whether data is being sent through a winsock control?
For example:
Private Sub cmdSendData_Click()
Winsock1.SendData "Hello, please help me"
End Sub
Private Sub cmdSendMoreData_Click()
If Winsock1 <> Sending Data Then
Winsock1.SendData "Ok"
Else
MsgBox "Data is currently being sent."
End If
End Sub
Anyone know how to do the 'If Winsock1 <> Sending Data Then' bit?
Thanks a lot
/Nick
-
Nov 26th, 2000, 08:01 PM
#2
New Member
Well, There's a way... but u won't like it.
When i was writing my peer-to-peer file server, i just declared a whole crapload of booleans...
(GEN DECS)
DIM SENDDATA AS BOOLEAN
Then all you have to do is trigger the boolean
(WHEN SENDING THE DATA)
LET SENDDATA = TRUE
WINSOCK1.SENDATA DATA
...
After that you use the winsock control's "send complete" event
(WINSOCK1 - SENDCOMPLETE EVENT SUB)
IF SENDDATA = TRUE THEN LET SENDDATA = FALSE
...This may seem all well and good if you have 1 or two data exchanges that you need to check on, but when you get up to about 12 the whole thing becomes un-manageable.
If anyone has a better way of doing this then LET ME KNOW VIA E-MAIL... PLEASE!
"Beyond the pretty wrapping paper, all life is, is just a struggle between one hard spot and the next, puncuated by a failure of biological systems."- Codewarrior123
-
Nov 26th, 2000, 08:57 PM
#3
PowerPoster
Winsock Events
Hi! Lympex, why not juz make used of the existing Winsock1_SendComplete() and Winsock1_SendProgress(ByVal bytesSent As Long, ByVal bytesRemaining As Long) events in the Winsock control? I think this can resolve your problem right.
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
|