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 :
- websockets same tcp/ip tcp/ip works on lower layer websockets.
- websockets might use less bandwidth because protocol might more efficient our current protocol.
- 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:
when want browser able connect (browsers support plain http requests , websocket connections - that's it).
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).
when want connect other type of client can more , use websocket connection can other protocol or custom protocol.
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).
when want interoperability proxies , other network infrastructure http , websockets provide.
Comments
Post a Comment