Page 1 of 2

sockets

Posted: Sun Jun 16, 2013 1:25 am
by monte
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?

Re: sockets

Posted: Sun Jun 16, 2013 11:42 am
by LCMark
@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...

Re: sockets

Posted: Sun Jun 16, 2013 11:54 am
by monte
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...

Re: sockets

Posted: Sun Jun 16, 2013 11:59 am
by LCMark
@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>

Re: sockets

Posted: Sun Jun 16, 2013 4:45 pm
by DarScott
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.)

Re: sockets

Posted: Sun Jun 16, 2013 9:42 pm
by monte
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...

Re: sockets

Posted: Mon Jun 17, 2013 8:52 am
by LCMark
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 :)

Re: sockets

Posted: Mon Jun 17, 2013 11:30 am
by monte
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

Re: sockets

Posted: Mon Jun 17, 2013 1:49 pm
by LCMark
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!

Re: sockets

Posted: Mon Jun 17, 2013 9:15 pm
by monte
Right, that's why I left my mucking around in notify out... don't let this distract you though.

Re: sockets

Posted: Tue Jun 18, 2013 8:41 am
by LCMark
@monte: I'll see if I get some time this morning :)

Re: sockets

Posted: Tue Jun 18, 2013 9:22 am
by monte
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.

Re: sockets

Posted: Tue Jun 18, 2013 6:26 pm
by LCMark
@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.

Re: sockets

Posted: Tue Jun 18, 2013 8:48 pm
by monte
awesome

Your message contains 7 characters. The minimum number of characters you need to enter is 10.

Re: sockets

Posted: Tue Jun 18, 2013 8:57 pm
by Janschenkel
@runrevmark: if you tell me where to look, I'll see if I can help untangle the Java synchronization stuff :-)