Sub socket1_connected(Successful As Boolean)
If Successful = False Then
Msgbox(LastException.Message, "Error connecting")
socket1.Close
Activity.Finish
Return
Else
AStreams.Initialize(socket1.InputStream, socket1.OutputStream, "AStreams")
ToastMessageShow("Connected", True)
End If
End Sub