Is websocket is dedicated for browsers only

随声附和 提交于 2019-12-10 18:47:27

问题


I am trying to program a native Objective-C and Native Android application using 3rd Party libraries. I have already chosen the libraries and I am already progressing in it.

One person in my team argues that the websocket currently implemented in concentration to web browsers, If we use this 3rd party libraries to implement the same from a native application it may not be stable.

He says maintaining a websocket connectivity from a native mobile application could be trivial, But webkit browsers already does that naturally, therefore we should think about creating a hybrod app.

Can anyone throw a comment on this?


回答1:


Websockets can be used by any client (read: "app"), as long as the client implements the Websocket protocol - no browser (or hybrid) required.

For example, SocketRocket is an Objective C library that helps you implement Websockets in iOS native apps.

There's a nice article here about implementing Websockets in native iOS and Android apps.

I think that implementing Websockets without Webkit is a better way to go. Creating a Hybrid app can impact performance. If you're using only one feature (websockets), Webkit might be too heavy.

The only question is - are the libraries you are implementing mature enough?

Good Luck!



来源:https://stackoverflow.com/questions/30974884/is-websocket-is-dedicated-for-browsers-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!