Hello!
I have a problem with a server-connection. When the server-connection is interrupted, the application will crash. Only the task-manager can end the program. The Errorlabel can' catch this crash. The lines below are my source-code to get the data from the server:
'Create the server-connection, when button is clicked'
Sub Button4_Click
ErrorLabel(noconnection)
WaitCursor(true)
client.New1 'init Client-Objekt'
IP_Adresse=textbox18.Text
Port_Nummer=textbox19.Text
Client.Connect (IP_Adresse,Port_Nummer)
If timer2.Enabled=false Then timer2.Enabled = true
WaitCursor(false)
Return
noconnection:
..
End Sub
'Takes the data from the server'
Sub Timer2_Tick
ErrorLabel(connectionbreak)
if ComboBox2.SelectedIndex = 1 then
If client.DataAvailable=true Then
Image4.LoadPicture("IconDaten1.bmp")
filestream.New1(client.GetStream,false)
GPS_Server.GPSStream(filestream.ReadString)
Else
Image4.LoadPicture("IconDaten2.bmp")
End If
else
if client.DataAvailable=true then filesstream.Readstring
End If
Return
connectionbreak:
..
client.close
End Sub
thanks....:sign0085:
I have a problem with a server-connection. When the server-connection is interrupted, the application will crash. Only the task-manager can end the program. The Errorlabel can' catch this crash. The lines below are my source-code to get the data from the server:
'Create the server-connection, when button is clicked'
Sub Button4_Click
ErrorLabel(noconnection)
WaitCursor(true)
client.New1 'init Client-Objekt'
IP_Adresse=textbox18.Text
Port_Nummer=textbox19.Text
Client.Connect (IP_Adresse,Port_Nummer)
If timer2.Enabled=false Then timer2.Enabled = true
WaitCursor(false)
Return
noconnection:
..
End Sub
'Takes the data from the server'
Sub Timer2_Tick
ErrorLabel(connectionbreak)
if ComboBox2.SelectedIndex = 1 then
If client.DataAvailable=true Then
Image4.LoadPicture("IconDaten1.bmp")
filestream.New1(client.GetStream,false)
GPS_Server.GPSStream(filestream.ReadString)
Else
Image4.LoadPicture("IconDaten2.bmp")
End If
else
if client.DataAvailable=true then filesstream.Readstring
End If
Return
connectionbreak:
..
client.close
End Sub
thanks....:sign0085: