Implementing support for native iOS compilation (#62)
Andrzej Wójcik (Tigase) opened 3 years ago

Implementing support for native iOS compilation

Andrzej Wójcik (Tigase) commented 3 years ago

I've implemented missing parts: DNS resolver, SocketConnector, socket, etc.

Initially, I've tried to use Network.framework from iOS for TCP connections, however, it was not possible, due to Kotlin Native limitations - at runtime it thrown exception that specific type of closure required to be passed to ObjC library is not supported.

Then I've switched to native TCP posix C code to create "socket" implementation for reading and writing data - and it works (even with StartTLS implemented using OpenSSL external library).

The only issue is that Halcyon crashes at runtime after some stanzas are exchanged and IDEA/KotlinNative/Gradle does not report the actual cause of the issue. I suppose it has something to do with multithreading. To move forward, it would be good to create a simple/dummy test iOS app (in future it would become our main app) in XCode using this library and then review crashes from the XCode level as it would give us better tools to analyze this issue.

issue 1 of 1
Type
Task
Priority
Normal
Assignee
Issue Votes (0)
Watchers (0)
Reference
tigase/_libraries/halcyon#62
Please wait...
Page is in error, reload to recover