Hi all,
I tried to write a winsock application, but I cannot understand something:
VB Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Sub Form_Load() Winsock1.Connect "127.0.0.1", 445 Sleep 1000 MsgBox Winsock1.State End Sub
If I run this code, the state is always 6, and not depends on sleep value.
But, if I add another msgbox, before the state, the state will be correct - 7:
VB Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Sub Form_Load() Winsock1.Connect "127.0.0.1", 445 Sleep 200 MsgBox ".." MsgBox Winsock1.State End Sub
Why shows the current state only, when I add another msgbox before it???
Thanks.




Reply With Quote