sockets - advantage WebSockets over TCP/IP -


we have application connects server , sends position every 15 seconds. our client has asked "upgrade" our current tcp/ip connection websocket. reason heard used less bandwidth , wants diminish 15 seconds 1 second. (not public application battery drain not problem)

i have done research , many websockets vs http comparisons 2 or 3 comparisons of websocket vs tcp/ip.

i've found out :

  1. websockets same tcp/ip tcp/ip works on lower layer websockets.
  2. websockets might use less bandwidth because protocol might more efficient our current protocol.
  3. websockets use more resources on server side.

my question is: worth change our existing code , make use of websockets instead of ol' tcp/ip sockets?

as appear know already, websocket built on top of tcp/ip connection. it's specific protocol built on top of tcp.

my question is: worth change our existing code , make use of websockets instead of ol' tcp/ip sockets?

if code works tcp socket , don't need interoperate browser client , don't need specific features built websockets, there no reason rewrite functioning tcp socket code.

we have application connects server , sends position every 15 seconds. our client has asked "upgrade" our current tcp/ip connection websocket. reason heard used less bandwidth , wants diminish 15 seconds 1 second. (not public application battery drain not problem)

whether or not websocket more bandwidth efficient existing tcp connection depends entirely upon protocol you're running on tcp connection. if existing protocol inefficient, benefit using more efficient protocol whether websocket or else. i'd surprised if switching websocket reduce 15 seconds 1 second unless implementation of have inefficient.

we comment further on comparison between 2 protocols if see how existing code/protocol works. if have bad, switching professionally designed system websockets might you, there's nothing innate in websockets makes them more efficient other designed protocol.


some of reasons use websocket on plain tcp connection other protocol on follows:

  1. when want browser able connect (browsers support plain http requests , websocket connections - that's it).

  2. when want message passing type of paradigm websocket offers , don't have specific protocol use on tcp (in other words when websocket saves having implement own protocol).

  3. when want connect other type of client can more , use websocket connection can other protocol or custom protocol.

  4. when you're trying share port web server. nature of being initiated via http connection switched on websocket protocol, websockets can operate on same port http server (sharing web server).

  5. when want interoperability proxies , other network infrastructure http , websockets provide.


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -