|
-
Apr 18th, 2006, 01:39 PM
#1
Need good Winsock tutorial
-
Apr 18th, 2006, 01:45 PM
#2
Re: Need good Winsock tutorial
Browse around vbip.com. They have many tutorials on the Winsock control.
-
Apr 18th, 2006, 01:45 PM
#3
Re: Need good Winsock tutorial
-
Apr 18th, 2006, 01:49 PM
#4
Re: Need good Winsock tutorial
Thanks. 
Another questions,
Does Winsock freezes (like URLDownloadToFile or Inet control) when you try to connect to a http site but there is no internet connection present ?
-
Apr 18th, 2006, 01:56 PM
#5
Re: Need good Winsock tutorial
 Originally Posted by iPrank
Thanks. 
Another questions,
Does Winsock freezes (like URLDownloadToFile or Inet control) when you try to connect to a http site but there is no internet connection present ?
if you dont create some code in the WS_Error event, then yes it will create the effect that your socket has frozen even though it actually has returned an error, so have something like this
VB Code:
Private Sub Winsock182_Error(ByVal Number As Integer, Description As String, ByVal Scode As Long, ByVal Source As String, ByVal HelpFile As String, ByVal HelpContext As Long, CancelDisplay As Boolean)
Winsock182.Close
MsgBox "Error (" & Number & "): " & Description, vbCritical, "Socket Error"
End Sub
this will give a msgbox saying the err num+description such as
---------------------------
Socket Error
---------------------------
Error (11001): Authoritative answer: Host not found
---------------------------
OK
---------------------------
best winsock site ever is www.winsockvb.com that is literally all you need, tuts for everything from basic chat to multi threaded downloads
-
Apr 18th, 2006, 02:28 PM
#6
Re: Need good Winsock tutorial
...just a little heads up for using winsock:
never ever do this as many do:
VB Code:
Private Sub Winsock1_Close()
MsgBox "Connection closed"
End Sub
you will be trapped forever until the end of time in a looping msgbox!
always use Close method before displaying the msgbox like
VB Code:
Private Sub Winsock1_Close()
Winsock182.Close
MsgBox "Connection closed"
End Sub
BTW the close event fires when the remote host terminates the connection
-
Apr 21st, 2006, 07:36 AM
#7
Re: Need good Winsock tutorial
Thanks everybody.
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
|