Probably a quick yes/no answer. Googling seemed to...
# squarelibraries
c
Probably a quick yes/no answer. Googling seemed to point to no... but, does okhttp support raw sockets over tcp (not websockets). The only reason I really ask is because I've been looking at ktor and it says it supports it, but my project already uses okhttp. /shruggie
j
Not quite sure what you're asking for. If it's a raw socket connection to a server then that's not HTTP and thus OkHttp does not do it.
c
using ktor in a few places for raw TCP sockets.
c
i just need to do some local raw socket stuff. and yeah. i figured okhttp works on http, but was surprised when i saw that ktor has support for it, so just wanted to make sure i wasn't missing something obvious with okhttp.
j
What does it give you? Just a multiplatform abstraction? If you're talking about OkHttp then you have access to the Java API so I'm not sure you need that much on top of those.
c
ktor provides coroutine-based socket connectivity, integrates nicely into non-blocking solutions.
👍 1
c
yeah im just straight up using Socket from java the programming language™️ apis. it works. but again. just wanted a quick sanity i wasn't missing something obvious.
j
Right but OkHttp and Okio don't subscribe to that notion. Blocking is the fastest and you can always layer non-blocking chunk sending/receiving on top of it.
👍 1
Yeah, I'd use the raw Socket stuff. You can use OkHttp's
Dns
interface if you want, but you probably don't need it.
❤️ 1
👍 1
Nevermind I thought
Dns
did more than it does. It does nothing for this case.
👍 1