what is the best way to connect to a stomp socket from swift 3?
web socket over stomp
If you have a web view handy you should be able to run the standard STOMP JavaScript code in that context. If not, you’ll have to either write or find a library for that protocol.
I don’t have any experience of third-party STOMP libraries, so I can’t help on that front.
If you plan to write a STOMP library yourself then you’d probably best start with NSURLSession. It makes the WebSocket side of things relatively straight forward (you can start a data task to do the HTTP side of things and then convert it to a stream task via
NSURLSessionResponseBecomeStream
). STOMP seems pretty simple, so implementing it on top of a stream task should be relatively straightforward.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"
Maybe this is too late, but for others, who have this problem. I wrote a library to connect to the Stomp server. You can download it using Cocoapods or SPM. Swift Stomp