在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):jwcpp/jwEngine开源软件地址(OpenSource Url):https://github.com/jwcpp/jwEngine开源编程语言(OpenSource Language):C 51.8%开源软件介绍(OpenSource Introduction):jwEngine一个跨平台的c++<->lua服务器快速解决方案,该框架即可快速响应服务器开发工作,设计思想:“让事情变得更简单” c++ tcp serverclass INetEvent : public NetEvent
{
public:
virtual void onAccept(NetConnect * conn){}
virtual void onClose(NetConnect * conn){}
virtual void onMsg(NetConnect * conn, int msgtype, NetPacket * pack){}
};
int main()
{
EventLoop::Instance()->init();
INetEvent eve;
NetServer server(EventLoop::Instance(), &eve);
server.listen("127.0.0.1", 3001);
return EventLoop::Instance()->run();
} lua tcp serverevent_init()
server = NetServer:new()
server.on_accept = function(conn)
end
server.on_close = function(conn)
end
server.on_msg = function(conn, msgtype, pack)
end
server:listen("127.0.0.1", 3001, false)
event_run() start run
serializationThe serialization tool provided is experimental and may be fragile. It is recommended to use more powerful protobuf Integrated open source librarylibuv Learn moreFor more examples, please refer to example 我的另一个项目:jwServer 有任何建议、BUG、疑问,统一解决QQ群:458421068 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论