1 Reply
      Latest reply on Jan 22, 2017 3:06 PM by eskimo
      enlightedravi Level 1 Level 1 (0 points)

        what is the best way to connect to a stomp socket from swift 3?

        • Re: web socket over stomp
          eskimo Apple Staff Apple Staff (13,325 points)

          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"