Closed dmg46664 closed 1 year ago
@dmg46664 Hi Daniel,
There is no evidence on the local server (already written with npm ws) that any connection attempt was made.
Sorry, can you please clarify: it sounds like you're trying to connect a Sente client to a a non-Sente server?
Or are you running make-channel-socket-server!
somewhere? Is that running successfully?
Thanks for a prompt response @ptaoussanis Yes, I am trying to connect Sente to a non-Sente server. Hopefully that clarifies. There is nothing on the readme page to suggest it isn't a bog-standard websocket api? (and what would be the value of creating a bespoke protocol so close to WebSockets?)
@dmg46664 No problem.
Yes, I am trying to connect Sente to a non-Sente server. Hopefully that clarifies.
Unfortunately Sente won't work in this case- a Sente client can connect only to a Sente server. That's why I was asking in your other issue what you were trying to do - since it surprised me to hear that you said you had no server.
There is nothing on the readme page to suggest it isn't a bog-standard websocket api?
I believe that the README and examples are hopefully reasonably clear that Sente is a client+server library that requires the server component? The Getting Started guide and examples all begin by starting a Sente server, and no support is claimed for the NodeJS WS library.
In any case, I understand that this must be frustrating news. I apologise if this could have been clearer, it hadn't occurred to me that someone might expect Sente to interop directly with NodeJS WS.
PR very welcome to help improve the README 👍
(and what would be the value of creating a bespoke protocol so close to WebSockets?)
As the README mentions, this will include things like the automatic buffering/batching, arbitrary Clojure value support, the built-in user-id mechanism, etc. Different libraries will inevitably offer different tradeoffs - Sente's objective was never interop with other servers, but a maximally pleasant experience for its common use case of Clojure server and Clojure clients.
Am not certain, but I guess there may be other lighter Clojure clients available that can interop directly with NodeJS WS.
Best of luck!
someone might expect Sente to interop directly with NodeJS WS
Not NodeJS WS, but the WebSocket protocol.
Yip, that is very frustrating 😢
like the automatic buffering/batching, arbitrary Clojure value support, the built-in user-id mechanism, etc.
None of the features mentioned in the quoted list conflict fundamentally with Websockets and so the expectation was this provides convenience on top of the protocol.
I thought the value add here was core.async
on top of Websockets, and so I wouldn't have to worry about Java/cljs(node/browser) and would have one api here.
and so I wouldn't have to worry about Java/cljs(node/browser) and would have one api here
Sorry, still not sure I clearly understand what you're trying to accomplish. In any case, it does seem that Sente won't be useful in your case due to its custom protocol.
You may want to consider just using WebSockets directly if possible (often pretty easy if you don't want auto fallback and all the other features), or you could check if there's other libraries around more in line with your needs.
Closing for now, but PR welcome if you'd like to suggest any clarifications to the README.
Cheers :-)
Hi,
I'm porting client test code over to sente (because I was using a node.js lib and core.async) but the actual target will be react-native.
There is no evidence on the local server (already written with npm ws) that any connection attempt was made. ❌ (eventual server will be AWS gateway websockets backed by lambda fns) ⚠️ I'm more perplexed however that I can't find a way to see any error state on the client, or any evidence as to the nature of connection attempt.
My code is as follows:
Apon calling this I can see the following coming from somewhere within
sente
but not failure message is in the logs.followed by my debug message:
Eventually the watch shows
but this doesn't give me the ability to look for the failed connection information. Only a change in state.
What am I doing wrong? TIA
P.S. Logging here as per https://github.com/ptaoussanis/sente/issues/406 your suggestion about node.js