![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Hello again!
I haven't found an answer on my problem, so i have one new idea: With the following sub, i take the data from the server. When the timer2_tick is 2000, the application runs fine, but I will take in backlog. So I only can get older data. I can see that, when I take a look at the UTC-Time. The different between the UTC-Time from the protocol which the server sends and the UTC-Time in the GPS_Server_GPSDecoded-sub runs up. But I think, that it is not possible to read from the filestream every half or one second, because the server sends only every two seconds. Now my idea: Is it possible to reset the filestream every read, so that i will not take in backlog and only take the new data? Sub Timer2_Tick ErrorLabel(connectionbreak) If ComboBox2.SelectedIndex = 1 Then If client.DataAvailable=true Then Image4.LoadPicture("IconDaten1.bmp") GPS_Server.GPSStream(filestream.ReadString) Else Image4.LoadPicture("IconDaten2.bmp") End If Else If client.DataAvailable Then fileStream.ReadString End If Return connectionbreak: .. client.close End Sub ![]() ![]() |
|
||||
|
If a backlog is building up then multiple messages must be available. Instead of just doing a single read try clearing the backlog with a Do While .. Loop.
Code:
Sub Timer2_Tick
ErrorLabel(connectionbreak)
If ComboBox2.SelectedIndex = 1 Then
If client.DataAvailable Then
Do While eclient.DataAvailable
GPS_Server.GPSStream(filestream.ReadString)
Loop
Image4.LoadPicture("IconDaten1.bmp")
Else
Image4.LoadPicture("IconDaten2.bmp")
End If
Else
Do While client.DataAvailable
fileStream.ReadString
Loop
End If
Return
connectionbreak:
..
client.close
End Sub
|
|
||||
|
This is my code, the same problem as my last posts. A simple code but it doesn' work:
Sub App_Start Form1.show client.New1 client.Connect("217.91.33.???,55355) filestream.New1(client.getstream,false) timer1.Enabled=true End Sub Sub timer1_Tick if client.DataAvailable=true then Label1.Text=filestream.readstring else Label1.Text="no data" end if End Sub The server sends only string as NMEA (RMC and GGA) every two seconds. When i block the gate from the server, so that there is no data sending, the application blocks in this line: Label1.Text=filestream.readstring. Than, there is no chance to end the application or even push a button. I have tested it with different timer from client and server, but it always stops in filestream.readstring. When I open the gate, the application will continue without problems. I have spoken with the author from the server-code. He says, that there is shure no data, when the gate is blocked. He says, that the filestream.readstring is a blocked function. It waits until there is any data. But i can't catch the mistake with client.dataavailable. Is it possible, that there is a different between reading the filestream until it is emty and read from a filetream, that is emty from the beginning? Because, if i read a full filestream until it is emty, then Label1.text shows "no data". When I connect to a port, where is no data from the beginning, the application stops an locks up until I gi´ve data to the stream. ![]() ![]() ![]() I think, that i will fall into despair.... |
|
||||
|
Quote:
I have tested more: when i open and close then gate from the server a lot of times, sometimes the application blocks and sometimes the label1.text shows "no data". I think, the is a different between the amount of data... |
|
||||
|
I don't understand your problems. I have used the Network library here Network "library" and on another app and it does not experience any blocking when no data is available.
It seems that your client.DataAvailable is returning true when there is no data to read, but I have not seen this behaviour myself ![]() What I do notice is "filestream.New1(client.getstream,false)" is specifying that the stream encoding is UTF8. Is this in fact true? I would have thought it more likely that the server data was ASCII encoded. Could this be why filestream is blocking? It might be that there is data available but it is expecting more data than is actually available dueto the encoding difference. EDIT :- Re-reading the thread you have said before that the app works OK when there is data so my encoding suggestion is probably wrong. Last edited by agraham : 03-18-2008 at 11:56 AM. |
|
||||
|
Hello agraham!
First I have tested it with filestream.new1(client.Getstream,true and false), but no different. I also have tested your Network Demo-Application. But This app only shows, that it ist connected with the server, but than, the application locks also up. This application doesn't work when there is data and also when there is no data. I have set the filestream.new1 on true and false, but no different. Is it possible to send you the original IP and port-no. to an email-adress? I can send data on this port for perhaps the next three hours. |
|
||||
|
You can certainly PM it to me but unless the problem is with your server there probably isn't much point. I have tested my Network demo in all the combinations possible of a Dell Axim X30 running WM2003SE, a Compaq latptop running Windows XP and my dekstop running Vista Home Premium. If my Network demo locks up I think there must be some sort of bug or problem with whatever you are running your app on. Have you tried it on both a device and a desktop?
|
|
||||
|
i have send a private message with the IP and port to you. I have tested the application on three different devices, not on the desktop. I don't think, that there is a problem with basic4ppc or your application Network Demo. I think, that i have overlook something by the data format from the server.
![]() |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| One server adn more clients | Byak@ | Questions & Help Needed | 2 | 08-12-2008 11:59 AM |
| Comunicating with a Telnet Server | lu_ozzie | Questions & Help Needed | 16 | 05-05-2008 06:25 PM |
| Simple NMEA logger | Bruno | Share Your Creations | 0 | 05-02-2008 08:43 PM |
| Checksum in nmea | wolfgang | Code Samples & Tips | 0 | 02-15-2008 02:42 PM |
| New server | Erel | Forum Discussion | 12 | 11-06-2007 05:21 PM |