??÷??????-Receiver?????????
???????????? ???????[ 2012/11/7 10:18:32 ] ????????
????4.3 so??
?????????????????????????????????????????receiver????plugin????????????????????
????class IPlugin
????{
????public:
????IPlugin( const std::string& name) ;
????virtual ~IPlugin();
????virtual const std::string& GetPluginName();
????virtual void Process( void *);
????protected:
????std::string m_strPluginName;
????};
????Receiver?????Epool??????????????socket??????????????????Process( void *)?????????????socket?????????????????????????????
???????????????£?
????testplugin.h:
????#include “plugin.h”
????class TestPlugin: public IPlugin{
????public:
????TestPlugin():IPlugin(“testplugin”){
????printf(“create TestPlugin ”);
????}
????void Process( void *);
????};
????testplugin.cpp:
????#include “testplugin.h”
????#include “mysocket.h”
????#include
????using namespace std;
????extern “C”
????TestPlugin* create_testplugin()
????{
????return new TestPlugin();
????}
????void TestPlugin::Process(void * p){
????int sock = (int)p;
????cout << ” handle epool event ?? socket= ” << sock << endl;
????SocketLayer::close_delepoll(sock);
????}
????5 ???????
????receiver??????: xml??(A)?????xml??(B)??so??(C)??????????????:
???? -r ?????????????????A?????
???? -s ?????????????????????A?????
???? -m ????????mcpack1??????????A?????
???? -x ????????mcpack2??????????A?????
???? -S ????????????A??B?????
???? -n ??????????(-1 ????????)??A??B?????
???? -l ?????????????????????A??B?????
???? -u ???????udp??A??B?????
???? -b ?????????xml??B?????
???? -d ????????so·????C?????
???? -a ????????so?????C?????
???? -t ??????????A??B??C?????
???? -p ????????A??B??C?????
????6 ???
????6.1 ??????б?
???? #randuint(a??b)???????a??b????????????
???? #timenow()????????????????
???? #md5(16??str)??????str????md5
???? #fromto(a??b)??????[a??b]?????????????д???????
???? #randin(a??b??c??d)????abcd????????????
???? flowlen()?????????????????
????6.2 ????????
???? int8_t uint8_t
???? int16_t uint16_t
???? int32_t uint32_t
???? int64_t uint64_t
???? int
???? time_t
???? long
???? short
???? char
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11