TCP socket on iOS ?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
raugert
Posts: 112
Joined: Thu May 26, 2016 9:30 pm
Location: Winnipeg, Canada

TCP socket on iOS ?

Post by raugert » Mon Feb 11, 2019 4:23 am

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.
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9837
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: TCP socket on iOS ?

Post by FourthWorld » Mon Feb 11, 2019 4:33 am

Is it a secure socket? I believe Apple requires that these days.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

raugert
Posts: 112
Joined: Thu May 26, 2016 9:30 pm
Location: Winnipeg, Canada

Re: TCP socket on iOS ?

Post by raugert » Mon Feb 11, 2019 4:41 am

Thanks for pointing that out. I'll give that a try.
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0

raugert
Posts: 112
Joined: Thu May 26, 2016 9:30 pm
Location: Winnipeg, Canada

Re: TCP socket on iOS ?

Post by raugert » Mon Feb 11, 2019 6:09 pm

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
Last edited by raugert on Mon Feb 11, 2019 6:25 pm, edited 1 time in total.
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9837
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: TCP socket on iOS ?

Post by FourthWorld » Mon Feb 11, 2019 6:23 pm

Does your server have an SSL certificate in place, such as those maintanable for free with the Let's Encrypt package?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

raugert
Posts: 112
Joined: Thu May 26, 2016 9:30 pm
Location: Winnipeg, Canada

Re: TCP socket on iOS ?

Post by raugert » Mon Feb 11, 2019 6:29 pm

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
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0

Pistris
Posts: 148
Joined: Mon Jul 20, 2015 2:40 am

Re: TCP socket on iOS ?

Post by Pistris » Wed Feb 27, 2019 9:26 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9837
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: TCP socket on iOS ?

Post by FourthWorld » Wed Feb 27, 2019 10:43 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Pistris
Posts: 148
Joined: Mon Jul 20, 2015 2:40 am

Re: TCP socket on iOS ?

Post by Pistris » Thu Feb 28, 2019 4:37 am

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

raugert
Posts: 112
Joined: Thu May 26, 2016 9:30 pm
Location: Winnipeg, Canada

Re: TCP socket on iOS ?

Post by raugert » Thu Apr 11, 2019 2:10 am

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
Livecode Indy 9.6.11 (Stable)
MacOS Sonoma 14.2
Xcode 15.0.1 SDK 17.0

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”