Its almost too easy, where could it all go wrong? ...
# random
u
Its almost too easy, where could it all go wrong? Should I rather use some actual ws client library?
g
But OkHttp websocket is “actual client library”
u
okay so if that works im cool? I always heard that websocket are finecky etc
what I meant was library like Scarlet / milion others, but looking at it now it basically provides deserializing the json and rx streams, but there is a reconnecting statemachine component to it which they were hyping up
g
OkHttp is a bit low level, all those deserilizing or rx staff is just wrappers for some websocket client, depends on your use case
u
yea its like retrofit, but its not the difficult to desiarialize manualy via moshi, or wrap into observables
so other than that, is there something to it you think? I was naively worried about some low level stuff, response codes, etc
g
I don’t know you exact use case, webscocket is not an API, protocol and highly depends on server and API implementation
u
use case shouldn matter, I was just expecting bit more to get it working. Now im seeing some okhttp.pingInterval(15, TimeUnit.SECONDS) in certain samples. Docs say its needed to keep the connection up. Guess this is what I had in mind with the finickiness, but hoping it will report the correct callback
Any chance you know how can I simulate a flaky ws server?
But I mean its tcp so if it fails it fails and I can do what I want then, right
l
@ursus You can make a test Android app, run it in the emulator, and use the GPRS/Edge/3G network quality simulators for bandwidth and latency to see that, and cut the network altogether too with airplane mode, or by cutting the connection of the host computer.