This socket component is made by the company that developed JMail.
A very old version of it. But it's pretty good. I've been using it all the time.
More stable. It was previously found that XMLHTTP was not very good on Win2003 server. The traffic is big and IIS is easy to drop. It's stable with this component.
Parahost = "www.knowsky.com"' Host
Paraport = ' Port '
Parafileurl = "/test/test.htm"
Set Socket = CreateObject ("Socket.tcp")
Socket.host = parahost & ":" & Paraport
Socket.timeout = Paratimeout
If err.number <> 0 Then Err.Clear
Socket.open
' Timeout error = 8000FFFF
Socket.sendline "Get" & Parafileurl & "http/1.0"
Socket.sendline "HOST:" & Parahost
Socket.sendline ""
Socket.sendline ""
' Sleep 200
Socket.waitfordisconnect
If err.number <> 0 Then
Response.Write Err.Number & "--" & Err.Description
err.clear
Else
Response.Write HttpResponse (Socket.buffer, 1) ' output text from Socket
end If
& nbsp; socket.close
Set Socket = Nothing
Private Function HttpResponse (ByVal tohttpresponse, ByVal whichhttpresponse)
On Error Resume Next
Dim Httpresponsedelimiter
Httpresponsedelimiter = Chr & Chr (a) & Chr (a) & Chr (10)
If (INSTR (1, Tohttpresponse, Httpresponsedelimiter, Vbbinarycompare) <> 0) Then
Select Case Whichhttpresponse
Case 0 ' Header
HttpResponse = Mid (Tohttpresponse, 1, (INSTR (1, Tohttpresponse, Httpresponsedelimiter, Vbbinarycompare)-1)
Case 1 ' body
HttpResponse = Mid (Tohttpresponse, INSTR (1, Tohttpresponse, Httpresponsedelimiter, Vbbinarycompare) + Len ( Httpresponsedelimiter)), (Len (Tohttpresponse)-(INSTR (1, Tohttpresponse, Httpresponsedelimiter, Vbbinarycompare)-1) ))
End Select
End If
End Function