So much thanks to you, TWELVE and AGRAHAM, for your efforts.
agraham said:I have not experienced any DataAvailable problems myself so I do not know whether this technique will sidestep any problems or not.
GPS_Server.GPSStream(filestream.ReadString)
The default timeout for a synchronous read on a NetworkStream is infinite. You could try changing it with the Door library - note that I haven't tried this myself so I don't know if it will work.What I need is a timeout-function for my client
Client.New1
Obj1.New1(False)
...
Client.Connect(....)
...
Obj1.Value = Client.GetStream
Obj1.SetProperty("ReadTimeout", 3000) ' timeout in mS
Client.New1
Obj1.New1(False)
...
Client.Connect(....)
...
Obj1.Value = Client.GetStream
Obj1.SetProperty("ReadTimeout", 3000) ' timeout in mS
Obj1.SetProperty("ReadTimeout", 3000) ' timeout in mS
What error message do you get?But on the device, I get an errorexception in this line:
Are you trapping the error with ErrorLabel and if so does it still drop
the connection? If you are trapping it and it does disconnect then there is
not much else you can do other than try to reconnect.
What error message do you get?
Does this only happen when it times out? If so that is what it is
documented to do.
Don't you get an exception on the desktop if it times out?
client.connect(...)
.....
oj1.value=client.getstream
obj1.setproperty("readtimeout",3000) 'here is the error
Well spotted Erel! :sign0188: I missed that. I hope that's all the problem is.The property name is case sensitive.
Sub App_Start
Form1.Show
client.New1
object1.New1(False)
Client.Connect ("217.91.....",.....)
filestream.New1(client.GetStream,False)
object1.Value=client.GetStream
object1.SetProperty("ReadTimeout",3000) <- error device
Label1.Text="Server connected!"
timer1.Enabled=True
End Sub
Sub Timer1_Tick
If client.DataAvailable=True Then
gps.GPSStream(filestream.ReadString)
Else
label2.Text="no data"
End If
End Sub
Sub GPS_GPSDecoded
....
....
End Sub
An error occurred on sub main.app_start.
Line number:17
object1.SetProperty("ReadTimeout",3000)
Error description:
Es kann keine Fehlermeldung angezeigt werdem, da die optionale Assembly,
die die Fehlermeldung enthält, nicht gefunden wurde.
Continue?
The documentation is not 100% clear as the online version doesn't say this.Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows CE Platform Note:
In .NET Compact Framework applications, the ReadTimeout property is supported, but reserved for future use. Using this property will raise an [T:System.InvalidOperationException,] until it is available in a future release of the .NET Compact Framework.
The documentation with VS2005 for a NetworkStream positively states ReadTimeout is available for the Compact Framework version 2.0.The documentation is not 100% clear as the online version doesn't say this.
One up already I see Erel :sign0188: Got your 214 yet?Visual Studio 2008
Yes. Looks like a great new (and pretty large) toyGot your 214 yet?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?