TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Bzzzt: Opening the door with Websockets and Raspberry Pi

45 点作者 zgryw大约 10 年前

3 条评论

kej大约 10 年前
&gt;For the Raspberry Pi server we decided to write some Python using Tornado and instead of using an HTTP like API - HTTP and APIs built on it using REST etc are in my opinion often used too often when plain old sockets will do the job! - we decided to negotiate a socket using WebSockets and then communicate messages as small as possible over that socket so that the latency was negligible.<p>Not that it matters much which tool you use for a job like this, but this part doesn&#x27;t really make sense. A WebSocket handshake is at least as big as this sort of REST request would have been, and if you wanted to keep everyone connected a basic TCP socket would work even better. They write how they had to implement a heartbeat on top of WebSockets, which seems like more work than the message framing on a TCP socket would have been.<p>Neat project just the same, though.
评论 #9305512 未加载
评论 #9305420 未加载
GauntletWizard大约 10 年前
I built a door system intended for a small office with a Pi, some sparkfun components, and Go. My code is here: <a href="https:&#x2F;&#x2F;github.com&#x2F;GauntletWizard&#x2F;vnw" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;GauntletWizard&#x2F;vnw</a> ; If anyone wants a more detailed explaination, I&#x27;ll try to write one up.
untog大约 10 年前
I&#x27;ll bite: what happen when the wifi goes out and there&#x27;s no-one inside the building?
评论 #9304679 未加载
评论 #9304695 未加载
评论 #9306860 未加载