Advertisement
athacks

Untitled

Jun 9th, 2015
547
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.73 KB | None | 0 0
  1. Sub Process_Globals
  2.     Dim Socket1 As Socket
  3. End Sub
  4.  
  5. Sub Globals
  6.  
  7. End Sub
  8.  
  9. Sub Activity_Create(FirstTime As Boolean)
  10.  
  11. Activity.LoadLayout("mainlayout")
  12.     Socket1.Initialize("Socket1")
  13.     Socket1.Connect("54.*.*.*" , 8383, 20000)
  14. End Sub
  15.  
  16. Sub Socket1_Connected (Successful As Boolean)
  17.     If Successful = False Then
  18.         Msgbox(LastException.Message, "Error connecting")
  19.         Return
  20.     End If
  21.     Dim tr As TextReader
  22.     tr.Initialize(Socket1.InputStream)
  23.     Dim sb As StringBuilder
  24.     sb.Initialize
  25.     sb.Append(tr.ReadLine) 'read at least one line
  26.     Do While tr.Ready
  27.         sb.Append(CRLF).Append(tr.ReadLine)
  28.     Loop
  29.     Msgbox("Time received: " & CRLF & sb.ToString, "")
  30.     Socket1.Close
  31. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement