sockets

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

sockets

Post by monte » Sun Jun 16, 2013 1:25 am

I've been having a look at sockets and why they aren't available on mobile. I'm not sure I really understand what's going on with the MCSocket definitions in sysspec but it seems to me that all the main implementation of sockets is in opensslsocket and the whole thing is #ifndefed out on MCSSL which is not defined for mobile... It looks to me like it might work if just sections of that file were #ifndefed out rather than the whole thing so that the secure flag and all the openssl code is just ignored on mobile. Am I missing something?
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: sockets

Post by LCMark » Sun Jun 16, 2013 11:42 am

@monte: Yes - the main implementation of sockets is in opensslsocket.cpp. The code in sysspec are just 'dummy' functions for dependencies elsewhere. If you can unhook opensslsocket.cpp from the OpenSSL functions that would be great - and it should (with appropriate hooks into the runloop) then work fine on mobile. We can then look at making the OpenSSL side optional - so that you can choose to use it on mobile if you need secure sockets (if you include industrial strength encryption in an app for the iOS AppStore, you have to declare it). The latter, of course, requires a build of OpenSSL for iOS/Android - and I think I have some stuff for that I started on a while ago somewhere...

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: sockets

Post by monte » Sun Jun 16, 2013 11:54 am

Well... I think I've hacked my way to a point where it should do something.. Crash maybe...
But it's still like the commands don't exist so I'm thinking I need to do something else to turn it on... Or remove something that turns it off...
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: sockets

Post by LCMark » Sun Jun 16, 2013 11:59 am

@monte: What commands aren't appearing to 'exist' / what error are you getting?

<meh>You cannot make another post so soon after your last.</meh>

DarScott
Posts: 227
Joined: Fri Jul 28, 2006 12:23 am
Location: Albuquerque
Contact:

Re: sockets

Post by DarScott » Sun Jun 16, 2013 4:45 pm

When I created a library for iOS with a capability very much like LiveCode sockets, I used an external with just a few basic socket operations using CFSocket. (The library was essentially LiveCode sockets with a slight change in interface, no SSL and a slight change in UDP behavior.)

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: sockets

Post by monte » Sun Jun 16, 2013 9:42 pm

OK, I set a breakpoint at MCOpen and followed the whole thing... it's opening the socket... I think I need to get MCNotifyPush to work on iOS and android...
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: sockets

Post by LCMark » Mon Jun 17, 2013 8:52 am

Ah - yes - the DNS resolution mechanism uses that... Should be easy enough to get to work though - happy to lend a hand there if you want :)

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: sockets

Post by monte » Mon Jun 17, 2013 11:30 am

Er.. ok, but beware that I've just been hacking my way forward and planned to clean things up once I worked out what was going on... to that end I've left out my musings on notify.cpp...

https://github.com/montegoulding/liveco ... c1290517e3
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: sockets

Post by LCMark » Mon Jun 17, 2013 1:49 pm

I was more meaning lending a hand with the notify stuff since I've already prodded that recently (on the externals_v5 branch) :)

Not sure my brain can cope with looking at the opensslsocket.cpp code at the moment - I'm currently trying to finalize the 'high-level' to 'native' type mapping system in the refactor branch and it's causing a minor headache!

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: sockets

Post by monte » Mon Jun 17, 2013 9:15 pm

Right, that's why I left my mucking around in notify out... don't let this distract you though.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: sockets

Post by LCMark » Tue Jun 18, 2013 8:41 am

@monte: I'll see if I get some time this morning :)

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: sockets

Post by monte » Tue Jun 18, 2013 9:22 am

Cool... I have a socket external I'm about to release that uses CocoaAsyncSocket but if we can get it to work in the engine that's better.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1207
Joined: Thu Apr 11, 2013 11:27 am

Re: sockets

Post by LCMark » Tue Jun 18, 2013 6:26 pm

@monte: Got a small amount of time to look at MCNotify on mobile today - got it working on iOS, Android is being stubborn... However, I think that is just my inexperience with Java synchronization stuff showing ;) I'll push at least the iOS stuff to a branch off of master (and integrate into develop) tomorrow morning.

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1564
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: sockets

Post by monte » Tue Jun 18, 2013 8:48 pm

awesome

Your message contains 7 characters. The minimum number of characters you need to enter is 10.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Location: Aalst, Belgium
Contact:

Re: sockets

Post by Janschenkel » Tue Jun 18, 2013 8:57 pm

@runrevmark: if you tell me where to look, I'll see if I can help untangle the Java synchronization stuff :-)
Quartam Reports & PDF Library for LiveCode
www.quartam.com

Locked

Return to “Engine Contributors”