Sub Process_Globals
Private so As Socket
Private astream As AsyncStreams
End Sub
Sub Globals
End Sub
Sub Activity_Create(FirstTime As Boolean)
so.InitializeSSL("so", Null, "")
so.Connect("bing.com", 443, 0)
End Sub
Sub so_Connected (Successful As Boolean)
Log(Successful)
If Successful Then
astream.Initialize(so.InputStream, so.OutputStream, "astream")
Dim s As String = _
$"GET / HTTP/1.1
Host: www.bing.com
"$
s = s.Replace(CRLF, Chr(13) & Chr(10))
astream.Write(s.GetBytes("utf8"))
Else
Log(LastException)
End If
End Sub
Sub astream_NewData (Buffer() As Byte)
Log(BytesToString(Buffer, 0, Buffer.Length, "utf8"))
End Sub
Sub astream_Error
End Sub
Sub astream_Terminated
so.Close
End Sub