Page 1 of 1

TCP socket on iOS ?

Posted: Mon Feb 11, 2019 4:23 am
by raugert
Can I use sockets on iPad apps. I have an app where I want to transfer a .csv file from Mac to an iPad. I thought I would use a TCP server/client connection to do this. The dictionary does indicate that the Open Socket command should work on iOS. I managed to get it to work somewhat in the simulator but not on the iPad as such. I figure it might be working in the simulator because it is local to the computer. Not sure.. just a thought.

Re: TCP socket on iOS ?

Posted: Mon Feb 11, 2019 4:33 am
by FourthWorld
Is it a secure socket? I believe Apple requires that these days.

Re: TCP socket on iOS ?

Posted: Mon Feb 11, 2019 4:41 am
by raugert
Thanks for pointing that out. I'll give that a try.

Re: TCP socket on iOS ?

Posted: Mon Feb 11, 2019 6:09 pm
by raugert
I have tried to use Open secure socket command, but it no longer responds to my Write commands. (I'm still trying to get it to work in the IDE and not an iOS standalone yet). I also tried adding Accept secure connections command at the server side, but no luck. The socket is indeed opened according to "the OpenSockets", but I cannot communicate between client and server when I add secure to the commands. Do I have to encrypt and decrypt the data when using secure sockets ? This secure thing is all new to me..

thanks,
Richard

Re: TCP socket on iOS ?

Posted: Mon Feb 11, 2019 6:23 pm
by FourthWorld
Does your server have an SSL certificate in place, such as those maintanable for free with the Let's Encrypt package?

Re: TCP socket on iOS ?

Posted: Mon Feb 11, 2019 6:29 pm
by raugert
Hi Richard,

My you have quick response ! :D

No I haven't added an SSL certificate to the server side (It's just a simple livecode server stack). I will have to do a bit more reading to find out how to do this.

thanks for your guidance,
Richard

Re: TCP socket on iOS ?

Posted: Wed Feb 27, 2019 9:26 pm
by Pistris
I have used sockets to transfer a photo and didn't have to use a secure socket

am using iOS version 11.2.1 on my phone

I have not tried it on an iPad but I don't see why it would be different

Re: TCP socket on iOS ?

Posted: Wed Feb 27, 2019 10:43 pm
by FourthWorld
My understanding is that new submissions to the Apple app store require that any web protocols require HTTPS, rather than the non-encrypted HTTP.

How this affects apps already in their app store, and how vigorously the policy is enforced, I can't say.

Re: TCP socket on iOS ?

Posted: Thu Feb 28, 2019 4:37 am
by Pistris
well my testing has been done here on my machine and iPhone
I have not done any on a published app
also I didn't use http, just pure binary data stream using sockets

Re: TCP socket on iOS ?

Posted: Thu Apr 11, 2019 2:10 am
by raugert
I am able to transfer binary images to ipad using sockets, as long as the files don’t exceed 60kb or so. If they are larger, the transfer doesn’t work on iPad but works fine on local computer. Have you succeeded with larger file transfers? I think it might have something to do with MTU (Maximum Transmission Unit) when transferring to iPad ? Do I have to send the files in chunks or something of the sort ? I’m sure I’m missing something..

Thank-you anyone for any advice
Richard