Hi,
I am working on a small program which acts as a network client to a micro controller as server.
For some reason the program hangs on the s=stream.ReadString statement.
The Network library version is 1.0.3678.39641.
The complete program looks as follows:
Sub App_Start
Form1.Show
Client.New1
Client.Connect("192.168.2.2",50000) 'the ip address of the micro controller and the port number, where the server listens.
stream.New1(Client.GetStream,True)
Msgbox("Connected")
Timer1.Interval=1000
Timer1.Enabled=True
End Sub
Sub Timer1_Tick
If Client.DataAvailable = True Then
s=stream.ReadString
TBSR.Text=TBSR.Text & CRLF & s
End If
End Sub
Sub CBSend_Click
stream.WriteString(TBS.Text)
TBSR.Text=TBSR.Text & CRLF & TBS.Text
End Sub
Sub CBDisconnect_Click
Client.Close
Msgbox("Disconnected.")
End Sub
The connection succeeds.
The micro controller works fine with a terminal emulator like MobileVT
Does somebody have an idea on the cause of this problem?
Harry
I am working on a small program which acts as a network client to a micro controller as server.
For some reason the program hangs on the s=stream.ReadString statement.
The Network library version is 1.0.3678.39641.
The complete program looks as follows:
Sub App_Start
Form1.Show
Client.New1
Client.Connect("192.168.2.2",50000) 'the ip address of the micro controller and the port number, where the server listens.
stream.New1(Client.GetStream,True)
Msgbox("Connected")
Timer1.Interval=1000
Timer1.Enabled=True
End Sub
Sub Timer1_Tick
If Client.DataAvailable = True Then
s=stream.ReadString
TBSR.Text=TBSR.Text & CRLF & s
End If
End Sub
Sub CBSend_Click
stream.WriteString(TBS.Text)
TBSR.Text=TBSR.Text & CRLF & TBS.Text
End Sub
Sub CBDisconnect_Click
Client.Close
Msgbox("Disconnected.")
End Sub
The connection succeeds.
The micro controller works fine with a terminal emulator like MobileVT
Does somebody have an idea on the cause of this problem?
Harry