linux安装socket.io,GitHub - yongboy/c_socket.io_server: The socket.io Linux C server

#The C socket.io server

##NOTES

The socket.io Linux C server, now just in developing at moment.

The server base on libev and glib, and run in linux systems now.

Before run the socket.io server, you have to install some dependencies before:

sudo apt-get install uuid-dev

sudo apt-get install libglib2.0-dev

git clone https://github.com/HardySimpson/zlog then make & make install it

The socket.io server may contains some hidden bugs, if you find it, please notice me :))

##How to use

write you implemetion, eg:chatroom.c

put your implemetion code(chatroom.c) in the example folder

create your static html files put them into static folder

edit the Makefile file

open the console, type #make

type ./socket.io_server

access your webpages in browser now, eg: http://localhost:8000/chatroom.html

enjoy it~

##The API NOTES

You have include the head file endpoint_impl.h within your code,which extends endpoint.h, the whole interface define, you can find here.

There are two demos in example folder, chatroom and whiteboard examples.

##说明

这是一个纯C语言版本的socket.io服务器端实现,目前仅支持linux系统,严重依赖libev and glib等基础库。

在运行socket.io_server之前,需要安装以下依赖:

sudo apt-get install uuid-dev

sudo apt-get install libglib2.0-dev

git clone https://github.com/HardySimpson/zlog then make & make install it

##如何运行

编写实现代码(eg:chatroom.c),需要包含头文件 endpoint_impl.h

把实现代码(eg:chatroom.c)放入examples目录

编写对应的html文件,放入static目录

编辑Makefile文件

终端下运行make命令

然后敲入 ./socket.io_server 接口运行

##API说明

对外的API,可以在头文件 endpoint_impl.h 看到其定义,其继承了另外一个公用的头文件 endpoint.h, 完整的面向实现代码的头文件定义见 完整定义.

在example目录中,你可以看到聊天室演示 chatroom 和在线白板示范 whiteboard .

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值