私信发送成功
Watch Star Fork

foryoung365 / UVSocketC++MIT

Server Socket and Client Socket based on libuv.
克隆/下载
Loading...
README.md 2.04 KB

#UVSocket

基于libuv的服务端和客户端Socket.

Server and Client socket based on libuv.

#Compile

这个工程使用premake5编译。从命令行运行:

premake5 vs2015

也可以选择生成其他你需要的visual studio版本(用premake5 --help命令查看更多选项)。打开VSbuild/UVSocket.sln文件,分别编译debug和release版本,然后运行根目录下的"Extract.bat",将所有头文件和库文件提取到项目根目录下的"publish"文件夹下.

You need premake5 to compile this project. Run this from command line:

premake5 vs2015

or other visual studio version(use premake5 --help for more details). Open VSBuild/UVSocket.sln and compile both Debug and Release version. Then run the "Extract.bat" to extract all libraries and header files to "publish" directory under project root directory.

#Supported platform

暂时只支持Windows. Linux应该也可以正常运行,但是未经测试。

Only Windows right now. But it should run well on Linux, but not be tested.

#Usage

编写一个你自己的类,继承"UVSocketCallBack.h"头文件中的IUVServerCallback 或者 IUVClientCallback(取决于你需要哪个),实现所有接口。你可以参考"TestClientSocket"和"TestServerSocket"中的用法。

Write your own class derived from IUVServerCallback or IUVClientCallback(decided by which socket do you need) in "UVSocketCallBack.h", and implement all interfaces.

You can take "TestClientSocket" and "TestServerSocket" for example.

#About Run Mode

暂时只支持同步模式,你必须在自己的线程循环中反复调用Run()来执行事件循环。 由于异步模式可能造成使用者的困惑,所以在没有找到更好的方案之前,暂时先去掉。

Only sync mode supported right now, you MUST keep calling Run() in your own thread. The async mode will make people confused, so I temporarily remove it. I am trying to find a better way to implement it.

项目点评 ( 0 )

你可以在登录后,对此项目发表评论

4_float_left_people 4_float_left_close