Datasnap, iOS and Sleep button - connection reset by peer.

I have never used DataSnap before, so I might have missed some basics.

Anyway: If you press the sleep button on the iPhone, and then open the app again, the connection to the datasnap server is lost.

I have for instance this simple procedure in an iOS-client, where I display a message using the sample EchoString-method in Datasnap:

procedure TForm1.Button2Click(Sender: TObject);
var
 Server:TServerMethods1Client;
begin
 Server:=TServerMethods1Client.Create(SQLConnection1.DBXConnection);
 Try
  ShowMessage(Server.EchoString('Test'));
  Finally
   Server.Free;
 End;
end;

If I press the button on the iPhone, everything works Ok - but if the phone goes to sleep (or I press the sleep button), I will get the error message "Socket Error # 54 Connection reset by peer" untill I kill the application and start it over again.

Is it possible to avoid this, and/or is there an event fired when it goes to sleep/wakes up?
0
Utf
6/7/2013 2:22:50 PM
embarcadero.delphi.ios 412 articles. 0 followers. Follow

2 Replies
1119 Views

Similar Articles

[PageSpeed] 42

Torje Rørvik

I've the same problem in my application, do you fix these problems??

Tks.


> {quote:title=Torje Rørvik wrote:}{quote}
> I have never used DataSnap before, so I might have missed some basics.
> 
> Anyway: If you press the sleep button on the iPhone, and then open the app again, the connection to the datasnap server is lost.
> 
> I have for instance this simple procedure in an iOS-client, where I display a message using the sample EchoString-method in Datasnap:
> 
> procedure TForm1.Button2Click(Sender: TObject);
> var
>  Server:TServerMethods1Client;
> begin
>  Server:=TServerMethods1Client.Create(SQLConnection1.DBXConnection);
>  Try
>   ShowMessage(Server.EchoString('Test'));
>   Finally
>    Server.Free;
>  End;
> end;
> 
> If I press the button on the iPhone, everything works Ok - but if the phone goes to sleep (or I press the sleep button), I will get the error message "Socket Error # 54 Connection reset by peer" untill I kill the application and start it over again.
> 
> Is it possible to avoid this, and/or is there an event fired when it goes to sleep/wakes up?
0
Pedro
9/11/2013 5:52:22 PM
Torje,

> I have never used DataSnap before, so I might have missed some basics.
> 
> Anyway: If you press the sleep button on the iPhone, and then open the 
> app again, the connection to the datasnap server is lost.

This might help:

https://developer.apple.com/library/ios/documentation/iphone/conceptual/iphoneosprogrammingguide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html
0
Egon
9/30/2013 12:50:30 PM
Reply:

Similar Artilces:

I can to install one not delphi program foir iOS into one iOS for delphi?
For example i have one programm builded as xcode for iOS, and i build one program as delphi for iOS. I want to have only one instalation, i can to add this xcode program into my delphi installer of my ios program? I can to do the same as android? how i can to to this? > {quote:title=oscar mejia wrote:}{quote} > For example i have one programm builded as xcode for iOS, and i build one program as delphi for iOS. I want to have only one instalation, i can to add this xcode program into my delphi installer of my ios program? > > I can to do the same as android? how i can to to...

IO::Socket, or any IO
------=_Part_110935_21218926.1156438461026 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I was thinking of rewriting a little webserver program I wrote in Perl 5 using Pugs. I was wondering what the equivilent (if any) of IO::Socket is. I suppose I could use an external webserver and use CGI to get this working with IO, but my preference would be a pure Perl 6 approach. If you're wondering, the program I wrote is a simple little webpage with two buttons so my wife can play music off my Linux box (with g...

Does Delphi for iOS come with native iOS UI controls?
According to this link http://www.embarcadero.com/products/delphi/ios-development, Delphi for iOS comes with "Pixel-perfect native UI controls". Are those controls the iOS native ones (UILabel, UIText, UISwitch, MKMapView, etc.), i.e. the same ones that one sees in XCode InterfaceBuilder? Le 31/01/13 19:02, Jacques Gonzalez a écrit : > According to this link http://www.embarcadero.com/products/delphi/ios-development, > Delphi for iOS comes with "Pixel-perfect native UI controls". > > Are those controls the iOS native ones (UILabel, UIText, UIS...

Can I do this with iOS apps developed in Delphi XE4 Pro + iOS?
I still don't have XE4/iOS as I have some questions first. Do I have access to iOS "native" library/system? What do I use for internet (downloading files etc.) - Indy? *If my research is correct, Google maps is available for iOS? Can I use Google maps or Apple's maps solutions in Delphi iOS apps?* If I have XE4 Pro, can I still use database functionality? Any restrictions? (Am I allowed to use what iOS offers or connect with a database on a webserver?) Anyone here developed demo apps I can see available in Apple iTunes store? (Even simple apps is okay as I onl...

Delphi XE4 - Firemonkey
I have an application that runs fine on windows, however when running on iOS simulator the onKeyUp event for a TEdit control is not being fired? Please advise if this event should get fired when running on iOS? This problem occurs onKeyUp events created directly on the control and by assigning the event programatically. Running XE4 update 1 iPhoneOS6.1.sdk Minimac: OS X 10.9 XCode 5 iOS Simulator Version 7.0 - iPad Retina / iOS 7.0.3(11B508) ...

DataSnap on iOS
Hello, I have created a small sample application to be run on iOS. I fetch some data from a REST Server. When I compile and run the application within the IDE it works fine. But I don't get it compiled in XCode. The error message is "Fatal: Can't find unit Datasnap used by Unit5" ... (where Unit5 is my example unit) Have I missed anything or is Datasnap not available in FPC? If Datasnap is not available in FPC, what will be the recommended way to create a REST client? Thank you, Michael > {quote:title=Schwarzl Michael wrote:}{quote} > Hello, > &g...

iOS and Datasnap
Hi All. I have a Datasnap Server and I'd like to connect to it with iOS. I have searched on the web and I have read all papers about this but I have seen only example with ReverseString. Where can I find a real exmple of accessing Data by Datasnap or using mobile connectors? Thanks > {quote:title=Flavio Basile wrote:}{quote} > Hi All. > > I have a Datasnap Server and I'd like to connect to it with iOS. > I have searched on the web and I have read all papers about this but I have seen only example with ReverseString. > > Where can I find a re...

Xe7-ios How to print with IOS
Hi I will like to print with my program on IOS Do you have example for that. On delphi I use command print; Thank Mario There are other ways but you can print via the ShareSheet functionality. https://www.youtube.com/watch?v=UWkM6fYN6aY > {quote:title=Eli M wrote:}{quote} > There are other ways but you can print via the ShareSheet functionality. > > https://www.youtube.com/watch?v=UWkM6fYN6aY Thank you It is a good idea but I have error when I compile this programm [DCC Erreur] uMain.pas(23): E2003 Identificateur non déclaré : ...

iOS on Pootle + iOS testing
Hi everyone, For all of those Pootle users out there, the iOS project is (mostly) back in business on Pootle! Please proceed to use Pootle to bring your iOS project up-to-date. Dwayne will be doing a fresh push into the SVN repos from your Pootle projects on Monday. Any progress you can make on iOS between now and then is much appreciated and will be seen in the next iOS Beta build. Currently, we are missing information about iOS testers for the following locales: * bn-IN * br * cs * de * dsb * eo * es * es-CL * es-MX * fr * gd * gl * ...

DataSnap IOS
Hello.. We have a Datasnap Server calling Microsoft SQL. When we try access that Datasnap server on IOS we get an error of "dbxmss.dll" not found. So there are no client installs for MS Sql on IOS. How can we access this datasnap with out needing a client install for MS Sql? We return values, not dataset.. Regards Shaun Churchyard Ok, so the answer if any one else is searching, create your DataSnap server as a Datasnap REST Application.. Then IOS do's not complain.. ...

DataSnap + iOS
Hi All I have just created a DataSnap server that runs as a Windows server on a Server 2012. All is good there. Next step I created the client for iOS and it also works perfect until...... The iPhone app goes to the background. Then the whole app is completelly useless and I have to kill the app and start again. How to handle this? I have looked for events when the app goes into background, but cannot find any event handlers for it. I was thinking about disconnecting the socket at that time and connect it again once the app becomes active again. I have tried both TCP/IP and HTTP with the...

Delphi XE8 FireMonkey iOS Style problem with segmented buttons
Hi, Going through some tutorials to get used to mobile development using FireMonkey and Delphi XE8. One of the most basic layouts tend to use the toolbar component with segmented speed buttons, and then applying the correct segmented style to each button. However, there seems to be an issue with the iOS style. ...

iOS and Datasnap
Hi all, I have used Delphi to develop for some time writing mainly front end clients for database applications. Having attended the Newark Delphi XE2 World Tour event I was so taken with the product I purchased the Ultimate version. Now the issue. I have no experience with Datasnap or iOS development which is my target platform for my next project. Can anyone point me in the right direction of any good tutorials, blogs, videos etc. that will get me up and running from scratch. Looking at posts and other blogs it looks like it could help quite a few other people as well. Hope th...

[perl6/specs] a7244f: spec .IO.z and s/IO::FileTests/IO::FileTestable/
----==_mimepart_536939ccdaec6_4d7ce1bd388431b Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Branch: refs/heads/master Home: https://github.com/perl6/specs Commit: a7244f9cec3ac63d82dcbcd6dceaff6d3877efed https://github.com/perl6/specs/commit/a7244f9cec3ac63d82dcbcd6dceaff6d3877efed Author: Tobias Leich <email@froggs.de> Date: 2014-05-06 (Tue, 06 May 2014) Changed paths: M S32-setting-library/IO.pod M contents.pod Log Message: ----------- spec .IO.z and s/IO::FileTests/IO::FileTestable/ niecza and rakud...

[perl6/specs] 3acfed: update IO::Path and IO::FileTests, OS-specific IO:...
----==_mimepart_517ceca6d9e5b_6141d6fe20430df Date: Sun, 28 Apr 2013 02:32:22 -0700 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-ID: <517ceca6da995_6141d6fe20431b5@hookshot-fe3-pe1-prd.aws.github.net.mail> Branch: refs/heads/master Home: https://github.com/perl6/specs Commit: 3acfeda8111674b72752bba03c9cbe02ded4c408 https://github.com/perl6/specs/commit/3acfeda8111674b72752bba03c9cbe02ded4c408 Author: Brent Laabs <bslaabs@gmail.com> Date: 2013-04-28 (Sun, 28 Apr 2013) Changed paths: M ...

Web resources about - Datasnap, iOS and Sleep button - connection reset by peer. - embarcadero.delphi.ios

Connection - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

iMedia Connection: Interactive Marketing News, Features, Podcasts and Video - iMediaConnection.com
If you send more email, you might make more money. Then again, you might destroy your reputation and revenue stream. Here's how to know what ...

HTTP persistent connection - Wikipedia, the free encyclopedia
... tacked on to an existing protocol. If the browser supports keep-alive, it adds an additional header to the request: Following this, the connection ...

MOTHER’S DAY: Facebook Examines Connections Between Moms, Kids
With Mother’s Day on the calendar this coming Sunday, Facebook examined the relationships between mothers and their children on the social network, ...

Police tear open roof to arrest man in connection with stabbing murder
Police have torn open the roof of a Gold Coast home to arrest a man in connection with the stabbing death of 16-year-old Michael Brack.

Paris attacks: Belgium connection probed as terrorist past of Brussels district of Molenbeek under spotlight ...
Prosecutors reveal a growing Belgian connection to the deadly Paris attacks, focusing on a poor Brussels district.

Half of data connections by top 500 Android apps are 'covert' with no effect on user experience
Researchers at the Massachusetts Institute of Technology have discovered that half of the communications connections established by the top free ...

Don’t Let Great Content Fall on Deaf Ears: Know your Connection Strategy
... via employee newsletter when it should have come through small-group manager meetings All of these and more are the result of a faulty connection ...

Brussels Connection Under Spotlight After Paris Killings
(EurActiv) — Prosecutors on Sunday disclosed a growing Belgian connection to the Paris attacks as Premier Charles Michel conceded that a Brussels ...

Be Goofy, Smile At Your Baby: Protection Begins with Connection, Pediatrician Says
VideoPart 3 of a series Andrew Garner wears silly ties and finds it easy to make a goofy face. These are valuable tools for charming the babies ...

Resources last updated: 11/22/2015 2:52:04 PM