D Dirk A Member Licensed User Longtime User Oct 8, 2012 #1 Hi , Since I've upgraded to v2.20 I've noticed the following problem : I'm using a socket that connects to my server application . Everything is ok with the connection but the problem is that when I close my server app (so that I'm sure that all sockets should be closed , or errors should be detected) my socket.connected is still true . I'm using an Asyncstream with the socket and when I send my 'alive sign' no errors are thrown when the server is down. Befor I upgraded to 2.20 I did not have this problem thank you edit : the server is a Delphi app Last edited: Oct 8, 2012
Hi , Since I've upgraded to v2.20 I've noticed the following problem : I'm using a socket that connects to my server application . Everything is ok with the connection but the problem is that when I close my server app (so that I'm sure that all sockets should be closed , or errors should be detected) my socket.connected is still true . I'm using an Asyncstream with the socket and when I send my 'alive sign' no errors are thrown when the server is down. Befor I upgraded to 2.20 I did not have this problem thank you edit : the server is a Delphi app
D Dirk A Member Licensed User Longtime User Oct 8, 2012 #2 I have reinstalled the v2.0 B4A and reloaded my older backup , here the problem does not occur (note : nothing has changed to the code , it was only compiled using v2.0) so there might be a bug in the 2.20 version Upvote 0
I have reinstalled the v2.0 B4A and reloaded my older backup , here the problem does not occur (note : nothing has changed to the code , it was only compiled using v2.0) so there might be a bug in the 2.20 version
P psdos Active Member Licensed User Longtime User Oct 8, 2012 #3 Are you update external librarys? Upvote 0
D Dirk A Member Licensed User Longtime User Oct 8, 2012 #4 I'm using Network 1.21 (for sockets) and RandomAccesFile 1.31 (for asyncstreams) Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 8, 2012 #5 Socket.Connected behave the same as in previous versions. Are you handling AsyncStreams_Terminated and AsyncStreams_Error events (you should handle these events)? Upvote 0
Socket.Connected behave the same as in previous versions. Are you handling AsyncStreams_Terminated and AsyncStreams_Error events (you should handle these events)?
D Dirk A Member Licensed User Longtime User Oct 9, 2012 #6 Erel , I did not handle the AsyncStreams_Terminated errors(only the AsyncStreams_Error ) , it seems to do the trick ! thanks ! But still , it's strange that the problem did not occur in the 2.0 version... Upvote 0
Erel , I did not handle the AsyncStreams_Terminated errors(only the AsyncStreams_Error ) , it seems to do the trick ! thanks ! But still , it's strange that the problem did not occur in the 2.0 version...
Erel B4X founder Staff member Licensed User Longtime User Oct 9, 2012 #7 This is actually related to a fix in AsyncStreams. Previously if the stream was unexpectedly closed then an error would have thrown when you tried to write to AsyncStream. There was a race condition between the Terminated event and the write method. This means that there wasn't a safe way to abort the writing. It was fixed as a result of a thorough investigation of B4A-Bridge crashes reports. Upvote 0
This is actually related to a fix in AsyncStreams. Previously if the stream was unexpectedly closed then an error would have thrown when you tried to write to AsyncStream. There was a race condition between the Terminated event and the write method. This means that there wasn't a safe way to abort the writing. It was fixed as a result of a thorough investigation of B4A-Bridge crashes reports.