WebSocket 开发库 Wslay
- 授权协议: MIT
- 开发语言: C/C++
- 操作系统: Linux
- 软件首页: http://wslay.sourceforge.net/
- 软件文档: http://wslay.sourceforge.net/tutorial.html
软件介绍
Wslay 是一个用 C 语言实现的 WebSocket 开发库。实现了 RFC 6455 中描述的第 13 版本的协议。提供了基于事件的 API 和基于帧的底层 API。特别适合非堵塞的 reactor 模式风格应用。可在不同的事件中设置回调。Wslay 只支持 WebSocket 协议的数据传输部分,不执行 HTTP 的握手过程。
示例代码:
ssize_t send_callback(wslay_event_context_ptr ctx,
const uint8_t *data, size_t len, void *user_data)
{
struct Session *session = (struct Session*)user_data;
ssize_t r;
int sflags = 0;
#ifdef MSG_MORE
if(flags & WSLAY_MSG_MORE) {
sflags |= MSG_MORE;
}
#endif // MSG_MORE
while((r = send(session->fd, data, len, sflags)) == -1 && errno == EINTR);
if(r == -1) {
if(errno == EAGAIN || errno == EWOULDBLOCK) {
wslay_event_set_error(ctx, WSLAY_ERR_WOULDBLOCK);
} else {
wslay_event_set_error(ctx, WSLAY_ERR_CALLBACK_FAILURE);
}
}
return r;
}
The Zen of CSS Design
Dave Shea、Molly E. Holzschlag / Peachpit Press / 2005-2-27 / USD 44.99
Proving once and for all that standards-compliant design does not equal dull design, this inspiring tome uses examples from the landmark CSS Zen Garden site as the foundation for discussions on how to......一起来看看 《The Zen of CSS Design》 这本书的介绍吧!
