View Single Post
  #4 (permalink)  
Old 11-06-2007, 11:52 AM
Erel's Avatar
Erel Erel is offline
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

You should remove the Dim client line.
Did you add a BinaryFile object named stream?
See this example:
You should add a Bitwise object named bit.
Code:
Sub Globals
    Dim buffer(0) As byte
End Sub

Sub App_Start
    bit.New1
    AddTimer("Timer1")
    Timer1.Interval = 500
End Sub

Sub Connect(IP)
    'ErrorLabel(errConnect)
    WaitCursor(true)
    TextBox2.Text = "Connecting to " & IP
    client.New1
    client.Connect(IP,23)
    stream.New1(client.GetStream,true)
    TextBox2.Text = "Connection established."
    timer1.Enabled = true
    WaitCursor(false)
End Sub

Sub Timer1_Tick
    If client.DataAvailable Then
        Dim buffer(4096) As byte
        count = stream.ReadBytes(buffer(),4096)
        TextBox2.Text = bit.BytesToString(buffer(),0,count)
    End If
End Sub
Reply With Quote