├── LICENSE
├── ReadMe.txt
├── btr0btr.cc
├── btr0btr.h
├── btr0btr.inl
├── btr0cur.cc
├── btr0cur.h
├── btr0cur.inl
├── btr0pcur.cc
├── btr0pcur.h
├── btr0pcur.inl
├── btr0sea.cc
├── btr0sea.h
├── btr0sea.inl
├── btr0types.h
├── buf0buf.cc
├── buf0buf.h
├── buf0buf.inl
├── buf0flu.cc
├── buf0flu.h
├── buf0flu.inl
├── buf0lru.cc
├── buf0lru.h
├── buf0lru.inl
├── buf0rea.cc
├── buf0rea.h
├── buf0types.h
├── cmake
├── CMakeLists.txt
├── core
│ └── CMakeLists.txt
├── daemon
│ └── CMakeLists.txt
├── revolver
│ └── CMakeLists.txt
├── rudp
│ └── CMakeLists.txt
├── rudprecv
│ └── CMakeLists.txt
├── rudpsend
│ └── CMakeLists.txt
├── sample
│ └── CMakeLists.txt
├── silencer
│ └── CMakeLists.txt
└── test
│ └── CMakeLists.txt
├── code_generator
├── code_generator.sln
├── code_generator
│ ├── code_generator.vcxproj
│ ├── code_generator.vcxproj.filters
│ ├── main.cpp
│ └── template
│ │ ├── ##file_prefix#.cpp
│ │ ├── ##file_prefix#_frame.cpp
│ │ ├── ##file_prefix#_frame.h
│ │ ├── ##file_prefix#_log.cpp
│ │ ├── ##file_prefix#_log.h
│ │ ├── ##file_prefix#_server.cpp
│ │ ├── ##file_prefix#_server.h
│ │ └── list.txt
└── strtk
│ └── strtk_combinations
│ └── strtk_combinations.vcxproj
├── common
├── core
│ ├── ReadMe.txt
│ ├── core.vcproj
│ ├── core.vcxproj
│ ├── core.vcxproj.filters
│ ├── core.vcxproj.user
│ ├── core_bandwidth_throttler.cpp
│ ├── core_bandwidth_throttler.h
│ ├── core_cmd_target.cpp
│ ├── core_cmd_target.h
│ ├── core_connection.cpp
│ ├── core_connection.h
│ ├── core_connection_manager.h
│ ├── core_connection_mananger.cpp
│ ├── core_daemon_client.cpp
│ ├── core_daemon_client.h
│ ├── core_daemon_event.h
│ ├── core_daemon_msg.h
│ ├── core_dc_client.cpp
│ ├── core_dc_client.h
│ ├── core_event_message.h
│ ├── core_frame.cpp
│ ├── core_frame.h
│ ├── core_local_info.h
│ ├── core_log_macro.cpp
│ ├── core_log_macro.h
│ ├── core_main.cpp
│ ├── core_main.h
│ ├── core_message_map_decl.cpp
│ ├── core_message_map_decl.h
│ ├── core_message_processor.cpp
│ ├── core_message_processor.h
│ ├── core_messgae_template.h
│ ├── core_msg_.h
│ ├── core_packet.cpp
│ ├── core_packet.h
│ ├── core_reactor_thread.cpp
│ ├── core_reactor_thread.h
│ ├── core_reciver_interface.h
│ ├── core_server_type.cpp
│ ├── core_server_type.h
│ ├── core_tcp_disconnect_notify.h
│ ├── core_tcp_listener.cpp
│ ├── core_tcp_listener.h
│ ├── core_udp_handler.cpp
│ ├── core_udp_handler.h
│ ├── data_center_msg.h
│ ├── dc_short_conn.cpp
│ └── dc_short_conn.h
├── def
│ ├── make.exe
│ ├── make.ilk
│ ├── sample_msg.def
│ ├── sample_msg.h
│ └── syntax_analysis.pdb
├── json
│ ├── json_stream.h
│ └── rapidjson
│ │ ├── document.h
│ │ ├── filestream.h
│ │ ├── internal
│ │ ├── pow10.h
│ │ ├── stack.h
│ │ └── strfunc.h
│ │ ├── prettywriter.h
│ │ ├── rapidjson.h
│ │ ├── reader.h
│ │ ├── stringbuffer.h
│ │ └── writer.h
├── revolver
│ ├── ReadMe.txt
│ ├── aes.c
│ ├── aes.h
│ ├── base64.cpp
│ ├── base64.h
│ ├── base_bin_stream.h
│ ├── base_bin_stream.inl
│ ├── base_block_buffer.h
│ ├── base_cache_buffer.h
│ ├── base_epoll_reactor.cpp
│ ├── base_epoll_reactor.h
│ ├── base_event_handler.cpp
│ ├── base_event_handler.h
│ ├── base_file.cpp
│ ├── base_file.h
│ ├── base_guard.h
│ ├── base_hex_string.cpp
│ ├── base_hex_string.h
│ ├── base_inet_addr.cpp
│ ├── base_inet_addr.h
│ ├── base_log.cpp
│ ├── base_log.h
│ ├── base_log_thread.cpp
│ ├── base_log_thread.h
│ ├── base_namespace.h
│ ├── base_nodes_load.cpp
│ ├── base_nodes_load.h
│ ├── base_os.h
│ ├── base_packet.h
│ ├── base_queue.h
│ ├── base_reactor.h
│ ├── base_reactor_instance.h
│ ├── base_select_reactor.cpp
│ ├── base_select_reactor.h
│ ├── base_singleton.h
│ ├── base_sock_acceptor.cpp
│ ├── base_sock_acceptor.h
│ ├── base_sock_connector.cpp
│ ├── base_sock_connector.h
│ ├── base_sock_dgram.cpp
│ ├── base_sock_dgram.h
│ ├── base_sock_stream.cpp
│ ├── base_sock_stream.h
│ ├── base_socket.cpp
│ ├── base_socket.h
│ ├── base_thread.cpp
│ ├── base_thread.h
│ ├── base_thread_mutex.h
│ ├── base_timer_value.cpp
│ ├── base_timer_value.h
│ ├── base_typedef.h
│ ├── crc_crypt.c
│ ├── crc_crypt.h
│ ├── date_time.cpp
│ ├── date_time.h
│ ├── gettimeofday.cpp
│ ├── gettimeofday.h
│ ├── lzo_object.cpp
│ ├── lzo_object.h
│ ├── lzoconf.h
│ ├── lzodefs.h
│ ├── md5.h
│ ├── md5c.c
│ ├── minilzo.c
│ ├── minilzo.h
│ ├── object_pool.h
│ ├── revolver.vcproj
│ ├── revolver.vcxproj
│ ├── revolver.vcxproj.filters
│ ├── revolver.vcxproj.user
│ ├── timer_node_t.h
│ ├── timer_node_t.inl
│ ├── timer_queue_t.h
│ ├── timer_queue_t.inl
│ ├── timer_ring.cpp
│ └── timer_ring.h
├── revolver_v12.sln
├── rudp
│ ├── ReadMe.txt
│ ├── rudp.vcxproj
│ ├── rudp.vcxproj.filters
│ ├── rudp.vcxproj.user
│ ├── rudp_acceptor.h
│ ├── rudp_adapter.cpp
│ ├── rudp_adapter.h
│ ├── rudp_adapter_interface.h
│ ├── rudp_ccc.cpp
│ ├── rudp_ccc.h
│ ├── rudp_channel_interface.h
│ ├── rudp_event_handler.h
│ ├── rudp_half_connection.h
│ ├── rudp_interface.cpp
│ ├── rudp_interface.h
│ ├── rudp_log_macro.cpp
│ ├── rudp_log_macro.h
│ ├── rudp_packet.h
│ ├── rudp_recv_buffer.cpp
│ ├── rudp_recv_buffer.h
│ ├── rudp_segment.cpp
│ ├── rudp_segment.h
│ ├── rudp_send_buffer.cpp
│ ├── rudp_send_buffer.h
│ ├── rudp_socket.cpp
│ ├── rudp_socket.h
│ ├── rudp_stream.cpp
│ └── rudp_stream.h
├── silencer
│ ├── ReadMe.txt
│ ├── daemon_config.cpp
│ ├── daemon_config.h
│ ├── dc_tcp_listener.cpp
│ ├── dc_tcp_listener.h
│ ├── sil_connection_hash.h
│ ├── silencer.vcxproj
│ ├── silencer.vcxproj.filters
│ └── silencer.vcxproj.user
└── vsproj
│ ├── core_v12.vcxproj
│ ├── core_v12.vcxproj.filters
│ ├── revolver_v12.vcxproj
│ ├── revolver_v12.vcxproj.filters
│ ├── rudp_v12.vcxproj
│ ├── rudp_v12.vcxproj.filters
│ ├── silencer_v12.vcxproj
│ └── silencer_v12.vcxproj.filters
├── daemon
├── daemon.cpp
├── daemon.sln
├── daemon.sln.docstates.suo
├── daemon.suo
├── daemon.vcproj
├── daemon.vcxproj
├── daemon.vcxproj.filters
├── daemon.vcxproj.user
├── daemon_element.cpp
├── daemon_element.h
├── daemon_frame.cpp
├── daemon_frame.h
├── daemon_json.h
├── daemon_log.cpp
├── daemon_log.h
├── daemon_physical.h
├── daemon_server.cpp
├── daemon_server.h
├── daemon_simple_physical.cpp
└── daemon_simple_physical.h
├── data0data.cc
├── data0data.h
├── data0data.inl
├── data0type.cc
├── data0type.h
├── data0type.inl
├── data0types.h
├── db0err.h
├── dict0boot.cc
├── dict0boot.h
├── dict0crea.cc
├── dict0crea.h
├── dict0dict.cc
├── dict0dict.h
├── dict0dict.inl
├── dict0load.cc
├── dict0load.h
├── dict0mem.cc
├── dict0mem.h
├── dict0types.h
├── dyn0dyn.cc
├── dyn0dyn.h
├── dyn0dyn.inl
├── eval0eval.h
├── eval0eval.inl
├── fil0fil.cc
├── fil0fil.h
├── fsp0fsp.cc
├── fsp0fsp.h
├── fsp0fsp.inl
├── fut0fut.h
├── fut0fut.inl
├── fut0lst.cc
├── fut0lst.h
├── fut0lst.inl
├── ha0ha.cc
├── ha0ha.h
├── ha0storage.cc
├── ha0storage.h
├── hash0hash.cc
├── hash0hash.h
├── ibuf0ibuf.cc
├── ibuf0ibuf.h
├── ibuf0ibuf.inl
├── ibuf0types.h
├── innodb.sln
├── innodb.vcxproj
├── innodb.vcxproj.filters
├── innodb.vcxproj.user
├── innodb_prj.udb
├── lexyy.c
├── license.txt
├── lock0lock.cc
├── lock0lock.h
├── lock0lock.inl
├── lock0types.h
├── log0log.cc
├── log0log.h
├── log0log.inl
├── log0recv.cc
├── log0recv.h
├── log0recv.inl
├── mach0data.cc
├── mach0data.h
├── mem0dbg.cc
├── mem0dbg.h
├── mem0mem.cc
├── mem0mem.h
├── mem0pool.cc
├── mem0pool.h
├── mtr0log.cc
├── mtr0log.h
├── mtr0log.inl
├── mtr0mtr.cc
├── mtr0mtr.h
├── mtr0mtr.inl
├── mtr0types.h
├── my_global.h
├── my_pthread.h
├── os0file.cc
├── os0file.h
├── os0sync.cc
├── os0sync.h
├── os0thread.cc
├── os0thread.h
├── page0cur.cc
├── page0cur.h
├── page0cur.inl
├── page0page.cc
├── page0page.h
├── page0page.inl
├── page0types.h
├── pars0grm.cc
├── pars0grm.h
├── pars0opt.cc
├── pars0opt.h
├── pars0pars.cc
├── pars0pars.h
├── pars0sym.cc
├── pars0sym.h
├── pars0types.h
├── protocol_analysis
├── sample_msg.def
├── syntax_analysis.sln
├── syntax_analysis.sln.docstates.suo
├── syntax_analysis.suo
└── syntax_analysis
│ ├── as_translator.cpp
│ ├── as_translator.h
│ ├── base_block_handler.cpp
│ ├── base_block_handler.h
│ ├── base_error.cpp
│ ├── base_error.h
│ ├── base_line_handler.cpp
│ ├── base_line_handler.h
│ ├── base_translator.cpp
│ ├── base_translator.h
│ ├── basedefine.cpp
│ ├── basedefine.h
│ ├── cpp_translator.cpp
│ ├── cpp_translator.h
│ ├── datatype_handler.cpp
│ ├── datatype_handler.h
│ ├── file_handler.cpp
│ ├── file_handler.h
│ ├── filetitle_handler.cpp
│ ├── filetitle_handler.h
│ ├── global.cpp
│ ├── global.h
│ ├── lua_translator.cpp
│ ├── lua_translator.h
│ ├── main.cpp
│ ├── memdesc_handler.cpp
│ ├── memdesc_handler.h
│ ├── message_handler.cpp
│ ├── message_handler.h
│ ├── namespace_handler.cpp
│ ├── namespace_handler.h
│ ├── sample_msg.h
│ ├── singleton.cpp
│ ├── singleton.h
│ ├── syntax_analysis.vcxproj
│ ├── syntax_analysis.vcxproj.filters
│ ├── syntax_analysis.vcxproj.user
│ ├── typedef_handler.cpp
│ ├── typedef_handler.h
│ ├── var_handler.cpp
│ └── var_handler.h
├── que0que.cc
├── que0que.h
├── que0que.inl
├── que0types.h
├── read0read.cc
├── read0read.h
├── read0read.inl
├── rem0cmp.cc
├── rem0cmp.h
├── rem0cmp.inl
├── rem0rec.cc
├── rem0rec.h
├── rem0rec.inl
├── rem0types.h
├── row0ins.cc
├── row0ins.h
├── row0mysql.cc
├── row0mysql.h
├── row0mysql.inl
├── row0purge.cc
├── row0purge.h
├── row0row.cc
├── row0row.h
├── row0row.inl
├── row0sel.cc
├── row0sel.h
├── row0sel.inl
├── row0types.h
├── row0uins.cc
├── row0uins.h
├── row0umod.cc
├── row0umod.h
├── row0undo.cc
├── row0undo.h
├── row0upd.cc
├── row0upd.h
├── row0upd.inl
├── row0vers.cc
├── row0vers.h
├── srv0que.cc
├── srv0que.h
├── srv0srv.cc
├── srv0srv.h
├── srv0start.cc
├── srv0start.h
├── sync0arr.cc
├── sync0arr.h
├── sync0rw.cc
├── sync0rw.h
├── sync0sync.cc
├── sync0sync.h
├── sync0types.h
├── test
├── rudp_reciver
│ ├── rudp_reciver.sln
│ └── rudp_reciver
│ │ ├── reciver_adapter.cpp
│ │ ├── reciver_adapter.h
│ │ ├── reciver_thread.cpp
│ │ ├── reciver_thread.h
│ │ ├── rudp_connection.cpp
│ │ ├── rudp_connection.h
│ │ ├── rudp_listen_handler.cpp
│ │ ├── rudp_listen_handler.h
│ │ ├── rudp_reciver.cpp
│ │ ├── rudp_reciver.vcxproj
│ │ ├── rudp_reciver.vcxproj.filters
│ │ ├── rudp_reciver.vcxproj.user
│ │ ├── udp_handler.cpp
│ │ └── udp_handler.h
├── rudp_sender
│ ├── rudp_sender.sln
│ └── rudp_sender
│ │ ├── reciver_adapter.cpp
│ │ ├── reciver_adapter.h
│ │ ├── reciver_thread.cpp
│ │ ├── reciver_thread.h
│ │ ├── rudp_connection.cpp
│ │ ├── rudp_connection.h
│ │ ├── rudp_listen_handler.cpp
│ │ ├── rudp_listen_handler.h
│ │ ├── rudp_reciver.cpp
│ │ ├── rudp_reciver.vcxproj
│ │ ├── rudp_reciver.vcxproj.filters
│ │ ├── rudp_reciver.vcxproj.user
│ │ ├── stat_packet.h
│ │ ├── udp_handler.cpp
│ │ └── udp_handler.h
├── sample_server
│ ├── sample_frame.cpp
│ ├── sample_frame.h
│ ├── sample_log_macro.cpp
│ ├── sample_log_macro.h
│ ├── sample_server.cpp
│ ├── sample_server.h
│ ├── sample_server.sln
│ ├── sample_server.sln.docstates.suo
│ ├── sample_server.suo
│ ├── sample_server.vcxproj
│ ├── sample_server.vcxproj.filters
│ ├── sample_server.vcxproj.user
│ └── server.cpp
├── test.sln
├── test.sln.docstates.suo
├── test.suo
└── test
│ ├── core_test.cpp
│ ├── core_test.h
│ ├── stat_packet.h
│ ├── test.cpp
│ ├── test.vcproj
│ ├── test.vcxproj
│ ├── test.vcxproj.filters
│ ├── test.vcxproj.user
│ ├── test_body.cpp
│ ├── test_body.h
│ ├── test_select.cpp
│ ├── test_select.h
│ ├── test_tcp_delay.cpp
│ └── test_tcp_delay.h
├── thr0loc.cc
├── thr0loc.h
├── trx0purge.cc
├── trx0purge.h
├── trx0purge.inl
├── trx0rec.cc
├── trx0rec.h
├── trx0rec.inl
├── trx0roll.cc
├── trx0roll.h
├── trx0rseg.cc
├── trx0rseg.h
├── trx0rseg.inl
├── trx0sys.c
├── trx0sys.h
├── trx0sys.inl
├── trx0trx.cc
├── trx0trx.h
├── trx0trx.inl
├── trx0types.h
├── trx0undo.cc
├── trx0undo.h
├── trx0undo.inl
├── ul0crc32.cc
├── ul0crc32.h
├── univ.h
├── usr0sess.cc
├── usr0sess.h
├── usr0types.h
├── ut0bh.cc
├── ut0bh.h
├── ut0byte.cc
├── ut0byte.h
├── ut0dbg.cc
├── ut0dbg.h
├── ut0list.cc
├── ut0list.h
├── ut0lst.h
├── ut0mem.cc
├── ut0mem.h
├── ut0rbt.cc
├── ut0rbt.h
├── ut0rnd.cc
├── ut0rnd.h
├── ut0ut.cc
├── ut0ut.h
├── ut0vec.cc
├── ut0vec.h
├── ut0wqueque.h
└── ut0wqueue.cc
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 zerok
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/ReadMe.txt:
--------------------------------------------------------------------------------
1 | +项目目录介绍:
2 | cmake linux 下cmake编译脚本,要首先安装cmake编译工具
3 | common revolver核心框架代码目录
4 | +revolver revolver基础封装代码目录
5 | +core revolver的框架代码目录
6 | +json 一个JSON的封装代码目录
7 | +rudp revolver的rudp实现代码目录
8 | +silencer revolver的服务器扩展代码目录
9 | daemon 精灵服务器代码目录
10 | protocol_analysis def协议翻译程序代码目录(由金山zhurw提供)
11 | test 测试代码目录(所有相关的模块测试例子、服务器框架例子等)
12 |
13 | 编译说明:
14 | 1.windows下
15 | 用VS 2010 打开common的工程,编译revolver的核心代码,让后可以在各个目录下打开相对应的工程进行编译,如果要使用到协议翻译器,请打开protocol_analysis目录下的工程进行编译,执行程序会生成在common/def目录下
16 | 2.linux下
17 | 先安装cmake编译器,在centos下用yum install cmake,在ubuntu下apt-get install cmake
18 | 切换到revolver/cmake目录,输入cmake .
19 | 完成后,make就可以生成各个执行文件,执行文件在revolver/cmake/bin下
20 |
21 | 需要了解关于revolver细节,请访问博客http://blog.csdn.net/column/details/zerok-revolver.html
22 |
--------------------------------------------------------------------------------
/btr0btr.cc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0btr.cc
--------------------------------------------------------------------------------
/btr0btr.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0btr.h
--------------------------------------------------------------------------------
/btr0btr.inl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0btr.inl
--------------------------------------------------------------------------------
/btr0cur.cc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0cur.cc
--------------------------------------------------------------------------------
/btr0cur.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0cur.h
--------------------------------------------------------------------------------
/btr0cur.inl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0cur.inl
--------------------------------------------------------------------------------
/btr0pcur.cc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0pcur.cc
--------------------------------------------------------------------------------
/btr0pcur.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0pcur.h
--------------------------------------------------------------------------------
/btr0pcur.inl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0pcur.inl
--------------------------------------------------------------------------------
/btr0sea.cc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0sea.cc
--------------------------------------------------------------------------------
/btr0sea.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0sea.h
--------------------------------------------------------------------------------
/btr0sea.inl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0sea.inl
--------------------------------------------------------------------------------
/btr0types.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/btr0types.h
--------------------------------------------------------------------------------
/buf0buf.cc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0buf.cc
--------------------------------------------------------------------------------
/buf0buf.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0buf.h
--------------------------------------------------------------------------------
/buf0buf.inl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0buf.inl
--------------------------------------------------------------------------------
/buf0flu.cc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0flu.cc
--------------------------------------------------------------------------------
/buf0flu.h:
--------------------------------------------------------------------------------
1 | #ifndef __buf0flu_h_
2 | #define __buf0flu_h_
3 |
4 | #include "unvi.h"
5 | #include "buf0types.h"
6 | #include "ut0byte.h"
7 | #include "mtr0types.h"
8 |
9 | #define BUF_FLUSH_FREE_BLOCK_MARGIN (5 + BUF_READ_AHEAD_AREA)
10 | #define BUF_FLUSH_EXTRA_MARGIN (BUF_FLUSH_FREE_BLOCK_MARGIN / 4 + 100)
11 |
12 |
13 |
14 | void buf_flush_write_complete(buf_block_t* block);
15 |
16 | void buf_flush_free_margin();
17 |
18 | void buf_flush_init_for_writing(byte* page, dulint newest_lsn, ulint space, ulint page_no);
19 |
20 | ulint buf_flush_batch(ulint flush_type, ulint min_n, dulint lsn_limit);
21 |
22 | void buf_flush_wait_batch_end(ulint type);
23 |
24 | UNIV_INLINE void buf_flush_note_modification(buf_block_t* block, mtr_t* mtr);
25 |
26 | UNIV_INLINE void buf_flush_recv_note_modification(buf_block_t* block, dulint start_lsn, dulint end_lsn);
27 |
28 | ibool buf_flush_ready_for_replace(buf_block_t* block);
29 |
30 | ibool buf_flush_validate();
31 |
32 | #include "buf0flu.h"
33 |
34 | #endif
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/buf0flu.inl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0flu.inl
--------------------------------------------------------------------------------
/buf0lru.cc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0lru.cc
--------------------------------------------------------------------------------
/buf0lru.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0lru.h
--------------------------------------------------------------------------------
/buf0lru.inl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0lru.inl
--------------------------------------------------------------------------------
/buf0rea.cc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0rea.cc
--------------------------------------------------------------------------------
/buf0rea.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/buf0rea.h
--------------------------------------------------------------------------------
/buf0types.h:
--------------------------------------------------------------------------------
1 | #ifndef __buf0types_h_
2 | #define __buf0types_h_
3 |
4 | typedef byte buf_frame_t;
5 |
6 | #endif
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/cmake/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 | PROJECT(all)
3 |
4 | #### library paths
5 | SET(LIBRARY_PATH "${CMAKE_SOURCE_DIR}/lib")
6 |
7 | #### output paths
8 | SET(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/lib")
9 | SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
10 |
11 | #### settings
12 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wno-deprecated")
13 | # SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
14 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
15 | SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -L${LIBRARY_PATH} -lpthread")
16 |
17 | #### projects
18 | ADD_SUBDIRECTORY(revolver)
19 | ADD_SUBDIRECTORY(rudp)
20 | ADD_SUBDIRECTORY(core)
21 | ADD_SUBDIRECTORY(silencer)
22 | ADD_SUBDIRECTORY(daemon)
23 | ADD_SUBDIRECTORY(test)
24 | ADD_SUBDIRECTORY(rudprecv)
25 | ADD_SUBDIRECTORY(rudpsend)
26 | ADD_SUBDIRECTORY(sample)
27 |
--------------------------------------------------------------------------------
/cmake/core/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 | PROJECT(core)
3 |
4 | # definitions
5 | #
6 |
7 | # includes
8 | SET(includes
9 | "../../common"
10 | "../../common/zlib"
11 | "./"
12 | )
13 | INCLUDE_DIRECTORIES(${includes})
14 |
15 | # sources
16 | FILE(GLOB sources_cpp "../../common/core/*.cpp")
17 |
18 | # targets
19 | ADD_LIBRARY (core STATIC ${sources_cpp})
20 |
--------------------------------------------------------------------------------
/cmake/daemon/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 | PROJECT(daemon)
3 |
4 | # definitions
5 | #
6 |
7 | # includes
8 | SET(includes
9 | "../../common"
10 | "../common"
11 | )
12 | INCLUDE_DIRECTORIES(${includes})
13 |
14 | SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin/daemon")
15 |
16 | # sources
17 | FILE(GLOB sources_cpp "../../daemon/*.cpp")
18 |
19 | # targets
20 | ADD_EXECUTABLE(daemond ${sources_cpp})
21 | TARGET_LINK_LIBRARIES(daemond silencer core revolver pthread)
22 |
--------------------------------------------------------------------------------
/cmake/revolver/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 | PROJECT(revolver)
3 |
4 | # definitions
5 | #
6 |
7 | # includes
8 | SET(includes
9 | "./"
10 | "../../common/"
11 | )
12 | INCLUDE_DIRECTORIES(${includes})
13 |
14 | # sources
15 | FILE(GLOB sources_cpp "../../common/revolver/*.cpp")
16 | FILE(GLOB sources_c "../../common/revolver/*.c")
17 |
18 | # targets
19 | ADD_LIBRARY (revolver STATIC ${sources_cpp} ${sources_c})
20 |
--------------------------------------------------------------------------------
/cmake/rudp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 | PROJECT(rudp)
3 |
4 | # definitions
5 | #
6 |
7 | # includes
8 | SET(includes
9 | "../../common"
10 | "./"
11 | )
12 | INCLUDE_DIRECTORIES(${includes})
13 |
14 | # sources
15 | FILE(GLOB sources_cpp "../../common/rudp/*.cpp")
16 |
17 | # targets
18 | ADD_LIBRARY (rudp STATIC ${sources_cpp})
19 |
--------------------------------------------------------------------------------
/cmake/rudprecv/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 | PROJECT(rudprecv)
3 |
4 | # definitions
5 | #
6 |
7 | # includes
8 | SET(includes
9 | "../../common"
10 | )
11 | INCLUDE_DIRECTORIES(${includes})
12 |
13 | SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin/rudprecv")
14 |
15 | # sources
16 | FILE(GLOB sources_cpp "../../test/rudp_reciver/rudp_reciver/*.cpp")
17 |
18 | # targets
19 | ADD_EXECUTABLE(rudprecv ${sources_cpp})
20 | TARGET_LINK_LIBRARIES(rudprecv silencer core rudp revolver pthread)
21 |
--------------------------------------------------------------------------------
/cmake/rudpsend/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 | PROJECT(rudpsend)
3 |
4 | # definitions
5 | #
6 |
7 | # includes
8 | SET(includes
9 | "../../common"
10 | )
11 | INCLUDE_DIRECTORIES(${includes})
12 |
13 | SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin/rudpsend")
14 |
15 | # sources
16 | FILE(GLOB sources_cpp "../../test/rudp_sender/rudp_sender/*.cpp")
17 |
18 | # targets
19 | ADD_EXECUTABLE(rudpsend ${sources_cpp})
20 | TARGET_LINK_LIBRARIES(rudpsend silencer core rudp revolver pthread)
21 |
--------------------------------------------------------------------------------
/cmake/sample/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 | PROJECT(sampled)
3 |
4 | # definitions
5 | #
6 |
7 | # includes
8 | SET(includes
9 | "../../common"
10 | )
11 | INCLUDE_DIRECTORIES(${includes})
12 |
13 | SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin/sample")
14 |
15 | # sources
16 | FILE(GLOB sources_cpp "../../test/sample_server/*.cpp")
17 |
18 | # targets
19 | ADD_EXECUTABLE(sampled ${sources_cpp})
20 | TARGET_LINK_LIBRARIES(sampled silencer core revolver pthread)
21 |
--------------------------------------------------------------------------------
/cmake/silencer/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 | PROJECT(silencer)
3 |
4 | # definitions
5 | #
6 |
7 | # includes
8 | SET(includes
9 | "../../common"
10 | )
11 | INCLUDE_DIRECTORIES(${includes})
12 |
13 | # sources
14 | FILE(GLOB sources_cpp "../../common/silencer/*.cpp")
15 |
16 | # targets
17 | ADD_LIBRARY (silencer STATIC ${sources_cpp})
18 |
--------------------------------------------------------------------------------
/cmake/test/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 | PROJECT(test)
3 |
4 | # definitions
5 | #
6 |
7 | # includes
8 | SET(includes
9 | "../../common"
10 | )
11 | INCLUDE_DIRECTORIES(${includes})
12 |
13 | SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin/test")
14 |
15 | # sources
16 | FILE(GLOB sources_cpp "../../test/test/*.cpp")
17 |
18 | # targets
19 | ADD_EXECUTABLE(test ${sources_cpp})
20 | TARGET_LINK_LIBRARIES(test silencer core revolver pthread)
21 |
--------------------------------------------------------------------------------
/code_generator/code_generator.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "code_generator", "code_generator\code_generator.vcxproj", "{374C512A-E826-4ECD-8EAB-31AD2822B02F}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {374C512A-E826-4ECD-8EAB-31AD2822B02F}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {374C512A-E826-4ECD-8EAB-31AD2822B02F}.Debug|Win32.Build.0 = Debug|Win32
14 | {374C512A-E826-4ECD-8EAB-31AD2822B02F}.Release|Win32.ActiveCfg = Release|Win32
15 | {374C512A-E826-4ECD-8EAB-31AD2822B02F}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/code_generator/code_generator/code_generator.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/code_generator/code_generator/template/##file_prefix#.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#.cpp
--------------------------------------------------------------------------------
/code_generator/code_generator/template/##file_prefix#_frame.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#_frame.cpp
--------------------------------------------------------------------------------
/code_generator/code_generator/template/##file_prefix#_frame.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#_frame.h
--------------------------------------------------------------------------------
/code_generator/code_generator/template/##file_prefix#_log.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#_log.cpp
--------------------------------------------------------------------------------
/code_generator/code_generator/template/##file_prefix#_log.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#_log.h
--------------------------------------------------------------------------------
/code_generator/code_generator/template/##file_prefix#_server.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#_server.cpp
--------------------------------------------------------------------------------
/code_generator/code_generator/template/##file_prefix#_server.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/code_generator/code_generator/template/##file_prefix#_server.h
--------------------------------------------------------------------------------
/code_generator/code_generator/template/list.txt:
--------------------------------------------------------------------------------
1 | ##file_prefix#_server.h
2 | ##file_prefix#_frame.h
3 | ##file_prefix#_server.cpp
4 | ##file_prefix#_frame.cpp
5 | ##file_prefix#_log.h
6 | ##file_prefix#_log.cpp
7 | ##file_prefix#.cpp
--------------------------------------------------------------------------------
/common/core/ReadMe.txt:
--------------------------------------------------------------------------------
1 | ========================================================================
2 | STATIC LIBRARY : core Project Overview
3 | ========================================================================
4 |
5 | AppWizard has created this core library project for you.
6 |
7 | No source files were created as part of your project.
8 |
9 |
10 | core.vcproj
11 | This is the main project file for VC++ projects generated using an Application Wizard.
12 | It contains information about the version of Visual C++ that generated the file, and
13 | information about the platforms, configurations, and project features selected with the
14 | Application Wizard.
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | Other notes:
18 |
19 | AppWizard uses "TODO:" comments to indicate parts of the source code you
20 | should add to or customize.
21 |
22 | /////////////////////////////////////////////////////////////////////////////
23 |
--------------------------------------------------------------------------------
/common/core/core.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/common/core/core_bandwidth_throttler.cpp:
--------------------------------------------------------------------------------
1 | #include "core_bandwidth_throttler.h"
2 |
3 | BASE_NAMESPACE_BEGIN_DECL
4 |
5 | CoreThrottler::CoreThrottler()
6 | {
7 | total_up_count_ = 0;
8 | total_down_count_ = 0;
9 |
10 | reset();
11 | }
12 |
13 | CoreThrottler::~CoreThrottler()
14 | {
15 |
16 | }
17 |
18 | void CoreThrottler::reset()
19 | {
20 | up_bandwidth_ = 0;
21 | down_bandwidth_ = 0;
22 |
23 | up_packet_count_ = 0;
24 | down_packet_count_ = 0;
25 |
26 | up_udp_count_ = 0;
27 | down_udp_count_ = 0;
28 |
29 | up_tcp_count_ = 0;
30 | down_tcp_count_ = 0;
31 | }
32 |
33 | void CoreThrottler::add_udp_packet(uint32_t packet_size, bool up /* = false */)
34 | {
35 | if(up)
36 | {
37 | up_bandwidth_ += packet_size;
38 | up_packet_count_ ++;
39 | up_udp_count_ ++;
40 |
41 | total_up_count_ ++;
42 | }
43 | else
44 | {
45 | down_bandwidth_ += packet_size;
46 | down_packet_count_ ++;
47 | down_udp_count_ ++;
48 |
49 | total_down_count_ ++;
50 | }
51 | }
52 |
53 | void CoreThrottler::add_tcp_packet(uint32_t packet_size, bool up /* = false */)
54 | {
55 | if(up)
56 | {
57 | up_bandwidth_ += packet_size;
58 | up_packet_count_ ++;
59 | up_tcp_count_ ++;
60 |
61 | total_up_count_ ++;
62 | }
63 | else
64 | {
65 | down_bandwidth_ += packet_size;
66 | down_packet_count_ ++;
67 | down_tcp_count_ ++;
68 |
69 | total_down_count_ ++;
70 | }
71 | }
72 |
73 | BASE_NAMESPACE_END_DECL
74 |
75 |
--------------------------------------------------------------------------------
/common/core/core_bandwidth_throttler.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_bandwidth_throttler.h
--------------------------------------------------------------------------------
/common/core/core_cmd_target.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_cmd_target.h
--------------------------------------------------------------------------------
/common/core/core_connection.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_connection.cpp
--------------------------------------------------------------------------------
/common/core/core_connection.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_connection.h
--------------------------------------------------------------------------------
/common/core/core_connection_manager.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_connection_manager.h
--------------------------------------------------------------------------------
/common/core/core_connection_mananger.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_connection_mananger.cpp
--------------------------------------------------------------------------------
/common/core/core_daemon_client.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_daemon_client.cpp
--------------------------------------------------------------------------------
/common/core/core_daemon_client.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_daemon_client.h
--------------------------------------------------------------------------------
/common/core/core_daemon_event.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_daemon_event.h
--------------------------------------------------------------------------------
/common/core/core_daemon_msg.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_daemon_msg.h
--------------------------------------------------------------------------------
/common/core/core_dc_client.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_dc_client.cpp
--------------------------------------------------------------------------------
/common/core/core_dc_client.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_dc_client.h
--------------------------------------------------------------------------------
/common/core/core_event_message.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_event_message.h
--------------------------------------------------------------------------------
/common/core/core_frame.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_frame.cpp
--------------------------------------------------------------------------------
/common/core/core_frame.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_frame.h
--------------------------------------------------------------------------------
/common/core/core_local_info.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_local_info.h
--------------------------------------------------------------------------------
/common/core/core_log_macro.cpp:
--------------------------------------------------------------------------------
1 | #include "core/core_log_macro.h"
2 |
3 | #ifdef WIN32
4 | SingleLogStream core_log("core", BaseLogStreamInterface::debug);
5 | #else
6 | BaseLogStream core_log("core", BaseLogStreamInterface::debug);
7 | #endif
8 |
9 |
--------------------------------------------------------------------------------
/common/core/core_log_macro.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_log_macro.h
--------------------------------------------------------------------------------
/common/core/core_main.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_main.cpp
--------------------------------------------------------------------------------
/common/core/core_main.h:
--------------------------------------------------------------------------------
1 | #ifndef __CORE_MAIN_H
2 | #define __CORE_MAIN_H
3 |
4 | #include "revolver/base_typedef.h"
5 |
6 | void ignore_pipe();
7 | int32_t core_main();
8 |
9 | #endif
10 |
--------------------------------------------------------------------------------
/common/core/core_message_map_decl.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_message_map_decl.cpp
--------------------------------------------------------------------------------
/common/core/core_message_map_decl.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_message_map_decl.h
--------------------------------------------------------------------------------
/common/core/core_message_processor.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_message_processor.cpp
--------------------------------------------------------------------------------
/common/core/core_message_processor.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_message_processor.h
--------------------------------------------------------------------------------
/common/core/core_messgae_template.h:
--------------------------------------------------------------------------------
1 | #ifndef CORE_MESSAGE_TEMPLATE_H
2 | #define CORE_MESSAGE_TEMPLATE_H
3 |
4 | #include "revolver/base_typedef.h"
5 | #include "revolver/base_inet_addr.h"
6 |
7 | BASE_NAMESPACE_BEGIN_DECL
8 |
9 | class BaseMsg
10 | {
11 | public:
12 | BaseMsg(){};
13 | virtual ~BaseMsg(){};
14 |
15 | public:
16 | uint32_t msg_type;
17 | };
18 |
19 | template
20 | class TypedBaseMsg : public BaseMsg
21 | {
22 | public:
23 | TypedBaseMsg() { msg_type = MSGTYPE;}
24 | virtual ~TypedBaseMsg() {};
25 | const T& data() const { return data_; }
26 | T& data() { return data_; }
27 | private:
28 | T data_;
29 | };
30 |
31 | BASE_NAMESPACE_END_DECL
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/common/core/core_msg_.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_msg_.h
--------------------------------------------------------------------------------
/common/core/core_packet.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_packet.cpp
--------------------------------------------------------------------------------
/common/core/core_packet.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_packet.h
--------------------------------------------------------------------------------
/common/core/core_reactor_thread.cpp:
--------------------------------------------------------------------------------
1 | #include "revolver/base_reactor_instance.h"
2 | #include "core/core_reactor_thread.h"
3 | BASE_NAMESPACE_BEGIN_DECL
4 |
5 | CCoreThread::CCoreThread()
6 | {
7 |
8 | }
9 |
10 | CCoreThread::~CCoreThread()
11 | {
12 |
13 | }
14 |
15 | void CCoreThread::execute()
16 | {
17 | while(!get_terminated())
18 | {
19 | REACTOR_INSTANCE()->event_loop();
20 | }
21 |
22 | REACTOR_INSTANCE()->stop_event_loop();
23 |
24 | clear_thread();
25 | }
26 |
27 | BASE_NAMESPACE_END_DECL
28 |
--------------------------------------------------------------------------------
/common/core/core_reactor_thread.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_reactor_thread.h
--------------------------------------------------------------------------------
/common/core/core_reciver_interface.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_reciver_interface.h
--------------------------------------------------------------------------------
/common/core/core_server_type.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_server_type.cpp
--------------------------------------------------------------------------------
/common/core/core_server_type.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_server_type.h
--------------------------------------------------------------------------------
/common/core/core_tcp_disconnect_notify.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_tcp_disconnect_notify.h
--------------------------------------------------------------------------------
/common/core/core_tcp_listener.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_tcp_listener.cpp
--------------------------------------------------------------------------------
/common/core/core_tcp_listener.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_tcp_listener.h
--------------------------------------------------------------------------------
/common/core/core_udp_handler.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_udp_handler.cpp
--------------------------------------------------------------------------------
/common/core/core_udp_handler.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/core_udp_handler.h
--------------------------------------------------------------------------------
/common/core/dc_short_conn.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/dc_short_conn.cpp
--------------------------------------------------------------------------------
/common/core/dc_short_conn.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/core/dc_short_conn.h
--------------------------------------------------------------------------------
/common/def/make.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/def/make.exe
--------------------------------------------------------------------------------
/common/def/make.ilk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/def/make.ilk
--------------------------------------------------------------------------------
/common/def/sample_msg.def:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/def/sample_msg.def
--------------------------------------------------------------------------------
/common/def/syntax_analysis.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/def/syntax_analysis.pdb
--------------------------------------------------------------------------------
/common/json/json_stream.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/json/json_stream.h
--------------------------------------------------------------------------------
/common/json/rapidjson/filestream.h:
--------------------------------------------------------------------------------
1 | #ifndef RAPIDJSON_FILESTREAM_H_
2 | #define RAPIDJSON_FILESTREAM_H_
3 |
4 | #include
5 |
6 | namespace rapidjson {
7 |
8 | //! Wrapper of C file stream for input or output.
9 | /*!
10 | This simple wrapper does not check the validity of the stream.
11 | \implements Stream
12 | */
13 | class FileStream {
14 | public:
15 | typedef char Ch; //!< Character type. Only support char.
16 |
17 | FileStream(FILE* fp) : fp_(fp), count_(0) { Read(); }
18 | char Peek() const { return current_; }
19 | char Take() { char c = current_; Read(); return c; }
20 | size_t Tell() const { return count_; }
21 | void Put(char c) { fputc(c, fp_); }
22 |
23 | // Not implemented
24 | char* PutBegin() { return 0; }
25 | size_t PutEnd(char*) { return 0; }
26 |
27 | private:
28 | void Read() {
29 | RAPIDJSON_ASSERT(fp_ != 0);
30 | int c = fgetc(fp_);
31 | if (c != EOF) {
32 | current_ = (char)c;
33 | count_++;
34 | }
35 | else
36 | current_ = '\0';
37 | }
38 |
39 | FILE* fp_;
40 | char current_;
41 | size_t count_;
42 | };
43 |
44 | } // namespace rapidjson
45 |
46 | #endif // RAPIDJSON_FILESTREAM_H_
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/common/json/rapidjson/internal/strfunc.h:
--------------------------------------------------------------------------------
1 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_
2 | #define RAPIDJSON_INTERNAL_STRFUNC_H_
3 |
4 | namespace rapidjson {
5 | namespace internal {
6 |
7 | //! Custom strlen() which works on different character types.
8 | /*! \tparam Ch Character type (e.g. char, wchar_t, short)
9 | \param s Null-terminated input string.
10 | \return Number of characters in the string.
11 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints.
12 | */
13 | template
14 | inline SizeType StrLen(const Ch* s) {
15 | const Ch* p = s;
16 | while (*p != '\0')
17 | ++p;
18 | return SizeType(p - s);
19 | }
20 |
21 | } // namespace internal
22 | } // namespace rapidjson
23 |
24 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_
25 |
--------------------------------------------------------------------------------
/common/json/rapidjson/stringbuffer.h:
--------------------------------------------------------------------------------
1 | #ifndef RAPIDJSON_STRINGBUFFER_H_
2 | #define RAPIDJSON_STRINGBUFFER_H_
3 |
4 | #include "rapidjson.h"
5 | #include "internal/stack.h"
6 |
7 | namespace rapidjson {
8 |
9 | //! Represents an in-memory output stream.
10 | /*!
11 | \tparam Encoding Encoding of the stream.
12 | \tparam Allocator type for allocating memory buffer.
13 | \implements Stream
14 | */
15 | template
16 | struct GenericStringBuffer {
17 | typedef typename Encoding::Ch Ch;
18 |
19 | GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}
20 |
21 | void Put(Ch c) { *stack_.template Push() = c; }
22 |
23 | void Clear() { stack_.Clear(); }
24 |
25 | const char* GetString() const {
26 | // Push and pop a null terminator. This is safe.
27 | *stack_.template Push() = '\0';
28 | stack_.template Pop(1);
29 |
30 | return stack_.template Bottom();
31 | }
32 |
33 | size_t Size() const { return stack_.GetSize(); }
34 |
35 | static const size_t kDefaultCapacity = 256;
36 | mutable internal::Stack stack_;
37 | };
38 |
39 | typedef GenericStringBuffer > StringBuffer;
40 |
41 | //! Implement specialized version of PutN() with memset() for better performance.
42 | template<>
43 | inline void PutN(GenericStringBuffer >& stream, char c, size_t n) {
44 | memset(stream.stack_.Push(n), c, n * sizeof(c));
45 | }
46 |
47 | } // namespace rapidjson
48 |
49 | #endif // RAPIDJSON_STRINGBUFFER_H_
50 |
51 |
52 |
--------------------------------------------------------------------------------
/common/revolver/ReadMe.txt:
--------------------------------------------------------------------------------
1 | ========================================================================
2 | STATIC LIBRARY : revolver Project Overview
3 | ========================================================================
4 |
5 | AppWizard has created this revolver library project for you.
6 |
7 | This file contains a summary of what you will find in each of the files that
8 | make up your revolver application.
9 |
10 |
11 | revolver.vcproj
12 | This is the main project file for VC++ projects generated using an Application Wizard.
13 | It contains information about the version of Visual C++ that generated the file, and
14 | information about the platforms, configurations, and project features selected with the
15 | Application Wizard.
16 |
17 |
18 | /////////////////////////////////////////////////////////////////////////////
19 |
20 | StdAfx.h, StdAfx.cpp
21 | These files are used to build a precompiled header (PCH) file
22 | named revolver.pch and a precompiled types file named StdAfx.obj.
23 |
24 | /////////////////////////////////////////////////////////////////////////////
25 | Other notes:
26 |
27 | AppWizard uses "TODO:" comments to indicate parts of the source code you
28 | should add to or customize.
29 |
30 | /////////////////////////////////////////////////////////////////////////////
31 |
--------------------------------------------------------------------------------
/common/revolver/aes.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/aes.h
--------------------------------------------------------------------------------
/common/revolver/base64.h:
--------------------------------------------------------------------------------
1 |
2 | //*********************************************************************
3 | //* C_Base64 - a simple base64 encoder and decoder.
4 | //*
5 | //* Copyright (c) 1999, Bob Withers - bwit@pobox.com
6 | //*
7 | //* This code may be freely used for any purpose, either personal
8 | //* or commercial, provided the authors copyright notice remains
9 | //* intact.
10 | //*********************************************************************
11 |
12 | #ifndef TALK_BASE_BASE64_H__
13 | #define TALK_BASE_BASE64_H__
14 |
15 | #include
16 | #include "revolver/base_namespace.h"
17 |
18 | BASE_NAMESPACE_BEGIN_DECL
19 |
20 | class Base64
21 | {
22 | public:
23 | static std::string encode(const std::string & data);
24 | static std::string decode(const std::string & data);
25 | static std::string encodeFromArray(const char * data, size_t len);
26 | private:
27 | static const std::string Base64Table;
28 | static const std::string::size_type DecodeTable[];
29 | };
30 |
31 | BASE_NAMESPACE_END_DECL
32 |
33 | #endif // TALK_BASE_BASE64_H__
34 |
--------------------------------------------------------------------------------
/common/revolver/base_bin_stream.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_bin_stream.h
--------------------------------------------------------------------------------
/common/revolver/base_bin_stream.inl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_bin_stream.inl
--------------------------------------------------------------------------------
/common/revolver/base_block_buffer.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_block_buffer.h
--------------------------------------------------------------------------------
/common/revolver/base_cache_buffer.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_cache_buffer.h
--------------------------------------------------------------------------------
/common/revolver/base_epoll_reactor.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_epoll_reactor.cpp
--------------------------------------------------------------------------------
/common/revolver/base_epoll_reactor.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_epoll_reactor.h
--------------------------------------------------------------------------------
/common/revolver/base_event_handler.cpp:
--------------------------------------------------------------------------------
1 | #include "base_reactor.h"
2 | #include "base_event_handler.h"
3 |
4 | BASE_NAMESPACE_BEGIN_DECL
5 |
6 | CEventHandler::CEventHandler() : reactor_index_(0)
7 | {
8 | reactor_ = NULL;
9 | }
10 |
11 | CEventHandler::~CEventHandler()
12 | {
13 | }
14 |
15 | BASE_HANDLER CEventHandler::get_handle() const
16 | {
17 | return INVALID_HANDLER;
18 | }
19 |
20 | void CEventHandler::set_handle(BASE_HANDLER handle)
21 | {
22 |
23 | }
24 |
25 | int32_t CEventHandler::handle_input(BASE_HANDLER handle)
26 | {
27 | return -1;
28 | }
29 |
30 | int32_t CEventHandler::handle_output(BASE_HANDLER handle)
31 | {
32 | return -1;
33 | }
34 |
35 | int32_t CEventHandler::handle_timeout(const void *act, uint32_t timer_id)
36 | {
37 | return -1;
38 | }
39 |
40 | int32_t CEventHandler::handle_exception(BASE_HANDLER handle)
41 | {
42 | return -1;
43 | }
44 |
45 | int32_t CEventHandler::handle_close(BASE_HANDLER handle, ReactorMask close_mask)
46 | {
47 | return -1;
48 | }
49 |
50 | CReactor* CEventHandler::reactor() const
51 | {
52 | return reactor_;
53 | }
54 |
55 | void CEventHandler::reactor(CReactor *r)
56 | {
57 | reactor_ = r;
58 | }
59 |
60 | void CEventHandler::add_timer_event(uint32_t id)
61 | {
62 | if(id > 0)
63 | {
64 | timer_events_.insert(id);
65 | }
66 | }
67 |
68 | void CEventHandler::del_timer_event(uint32_t id)
69 | {
70 | if(id > 0)
71 | {
72 | timer_events_.erase(id);
73 | }
74 | }
75 |
76 | void CEventHandler::clear_timer_events()
77 | {
78 | if(reactor_ == NULL)
79 | return ;
80 |
81 | BaseEventIDSet::iterator it = timer_events_.begin();
82 | uint32_t id = 0;
83 |
84 | while(it != timer_events_.end())
85 | {
86 | id = *it;
87 | it ++;
88 |
89 | const void* act = NULL;
90 | reactor_->cancel_timer(id, &act);
91 | if(act != NULL)
92 | {
93 | release_timer_act(act);
94 | }
95 | }
96 |
97 | timer_events_.clear();
98 | reactor_ = NULL;
99 | }
100 |
101 | void CEventHandler::release_timer_act(const void* act)
102 | {
103 |
104 | }
105 |
106 | BASE_NAMESPACE_END_DECL
107 |
--------------------------------------------------------------------------------
/common/revolver/base_event_handler.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_event_handler.h
--------------------------------------------------------------------------------
/common/revolver/base_file.h:
--------------------------------------------------------------------------------
1 | #ifndef __BASE_FILE_H
2 | #define __BASE_FILE_H
3 |
4 | #include
5 | #include "revolver/base_typedef.h"
6 | #include "revolver/base_namespace.h"
7 | #include "revolver/base_os.h"
8 |
9 | using namespace std;
10 |
11 | BASE_NAMESPACE_BEGIN_DECL
12 |
13 | enum BaseFileState
14 | {
15 | SS_CLOSED,
16 | SS_OPENING,
17 | SS_OPEN
18 | };
19 |
20 | enum BaseFileResult
21 | {
22 | SR_ERROR,
23 | SR_SUCCESS,
24 | SR_BLOCK,
25 | SR_EOS
26 | };
27 |
28 | enum BaseFileEvent
29 | {
30 | SE_OPEN = 1,
31 | SE_READ = 2,
32 | SE_WRITE = 4,
33 | SE_CLOSE = 8
34 | };
35 |
36 |
37 | class BaseFile
38 | {
39 | public:
40 | BaseFile();
41 | ~BaseFile();
42 |
43 | bool open(const string& filename, const char* mode);
44 | void close();
45 |
46 | bool disable_buffering();
47 |
48 |
49 | uint8_t get_state() const;
50 |
51 | BaseFileResult read(void* buffer, size_t buffer_len, size_t& read_size, int32_t& error);
52 | BaseFileResult write(const void* data, size_t data_len, size_t& writte_size, int& error);
53 |
54 | void seek(size_t pos);
55 | void flush();
56 |
57 | bool set_postion(size_t pos);
58 | bool get_postion(size_t& pos) const;
59 |
60 | protected:
61 | FILE* file_;
62 | };
63 | BASE_NAMESPACE_END_DECL
64 |
65 | #endif
66 |
--------------------------------------------------------------------------------
/common/revolver/base_guard.h:
--------------------------------------------------------------------------------
1 | #ifndef __BASE_GUARD_H
2 | #define __BASE_GUARD_H
3 |
4 | #include "revolver/base_namespace.h"
5 |
6 | BASE_NAMESPACE_BEGIN_DECL
7 | template
8 | class BaseGuard
9 | {
10 | public:
11 | BaseGuard(BASE_MUTEX &mutex) : mutex_(mutex)
12 | {
13 | mutex_.acquire();
14 | locked_ = true;
15 | };
16 |
17 | ~BaseGuard()
18 | {
19 | locked_ = false;
20 | mutex_.release();
21 | };
22 |
23 | bool locked() const
24 | {
25 | return locked_;
26 | };
27 |
28 | private:
29 | BASE_MUTEX& mutex_;
30 | bool locked_;
31 | };
32 |
33 | BASE_NAMESPACE_END_DECL
34 |
35 | #define BASE_GUARD_ACTION(MUTEX, OBJ, LOCK, ACTION, REACTION) \
36 | BaseGuard OBJ(LOCK);\
37 | if(OBJ.locked()){ ACTION; } \
38 | else { REACTION; }
39 |
40 | #define BASE_GUARD_REACTION(MUTEX, OBJ, LOCK, REACTION) \
41 | BASE_GUARD_ACTION(MUTEX, OBJ, LOCK, ;, REACTION)
42 |
43 | #define BASE_GUARD(MUTEX, OBJ, LOCK) \
44 | BASE_GUARD_REACTION(MUTEX, OBJ, LOCK, return)
45 |
46 | #define BASE_GUARD_RETURN(MUTEX, OBJ, LOCK, REACTION)\
47 | BASE_GUARD_REACTION(MUTEX, OBJ, LOCK, return REACTION)
48 | #endif
49 |
--------------------------------------------------------------------------------
/common/revolver/base_hex_string.h:
--------------------------------------------------------------------------------
1 | #ifndef __BASE_HEX_STRING_H
2 | #define __BASE_HEX_STRING_H
3 |
4 | #include "revolver/base_typedef.h"
5 | #include "revolver/base_namespace.h"
6 |
7 | #include
8 | using namespace std;
9 |
10 | BASE_NAMESPACE_BEGIN_DECL
11 |
12 | string bin2asc(const uint8_t *in, int32_t in_size);
13 |
14 | void asc2bin(const string& in, uint8_t* out, int32_t out_size, int32_t &out_length);
15 |
16 | BASE_NAMESPACE_END_DECL
17 | #endif
18 |
--------------------------------------------------------------------------------
/common/revolver/base_inet_addr.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_inet_addr.cpp
--------------------------------------------------------------------------------
/common/revolver/base_inet_addr.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_inet_addr.h
--------------------------------------------------------------------------------
/common/revolver/base_log.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_log.cpp
--------------------------------------------------------------------------------
/common/revolver/base_log.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_log.h
--------------------------------------------------------------------------------
/common/revolver/base_log_thread.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_log_thread.cpp
--------------------------------------------------------------------------------
/common/revolver/base_log_thread.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_log_thread.h
--------------------------------------------------------------------------------
/common/revolver/base_namespace.h:
--------------------------------------------------------------------------------
1 | #ifndef __BASE_NAMESPACE_H
2 | #define __BASE_NAMESPACE_H
3 |
4 | #define BASE_NAMESPACE_BEGIN_DECL namespace BASEOBJECT {
5 | #define BASE_NAMESPACE_END_DECL }
6 |
7 | #define BASE_NAMEPSACE_DECL BASEOBJECT
8 |
9 | #define BASE BASEOBJECT
10 | #endif
11 |
--------------------------------------------------------------------------------
/common/revolver/base_nodes_load.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_nodes_load.cpp
--------------------------------------------------------------------------------
/common/revolver/base_nodes_load.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_nodes_load.h
--------------------------------------------------------------------------------
/common/revolver/base_os.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_os.h
--------------------------------------------------------------------------------
/common/revolver/base_packet.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_packet.h
--------------------------------------------------------------------------------
/common/revolver/base_queue.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_queue.h
--------------------------------------------------------------------------------
/common/revolver/base_reactor.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_reactor.h
--------------------------------------------------------------------------------
/common/revolver/base_reactor_instance.h:
--------------------------------------------------------------------------------
1 | #ifndef __BASE_REACTOR_INSTANCE_H
2 | #define __BASE_REACTOR_INSTANCE_H
3 |
4 | #include "revolver/base_select_reactor.h"
5 | #include "revolver/base_epoll_reactor.h"
6 |
7 | #ifdef WIN32
8 | #define REACTOR_CREATE CSingleton::instance
9 | #define REACTOR_INSTANCE CSingleton::instance
10 | #define REACTOR_DESTROY CSingleton::destroy
11 | #else
12 | #define REACTOR_CREATE CSingleton::instance
13 | #define REACTOR_INSTANCE CSingleton::instance
14 | #define REACTOR_DESTROY CSingleton::destroy
15 | #endif
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/common/revolver/base_select_reactor.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_select_reactor.cpp
--------------------------------------------------------------------------------
/common/revolver/base_select_reactor.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_select_reactor.h
--------------------------------------------------------------------------------
/common/revolver/base_singleton.h:
--------------------------------------------------------------------------------
1 | #ifndef __BASE_SIGNLETON_H
2 | #define __BASE_SIGNLETON_H
3 |
4 | #include
5 |
6 | template
7 | class CSingleton
8 | {
9 | public:
10 | static T* instance()
11 | {
12 | if(obj_ == NULL)
13 | {
14 | obj_ = new T();
15 | }
16 |
17 | return obj_;
18 | };
19 |
20 | static void destroy()
21 | {
22 | if(obj_ != NULL)
23 | {
24 | delete obj_;
25 | obj_ = NULL;
26 | }
27 | };
28 |
29 | protected:
30 | CSingleton()
31 | {
32 | };
33 |
34 | virtual ~CSingleton()
35 | {
36 | };
37 |
38 | protected:
39 | static T* obj_;
40 |
41 | private:
42 | CSingleton(const CSingleton&)
43 | {
44 | };
45 |
46 | CSingleton& operator=(const CSingleton&)
47 | {
48 | };
49 | };
50 |
51 |
52 | template
53 | T* CSingleton::obj_ = NULL;
54 |
55 | #endif
56 |
57 |
--------------------------------------------------------------------------------
/common/revolver/base_sock_acceptor.cpp:
--------------------------------------------------------------------------------
1 | #include "base_sock_acceptor.h"
2 |
3 | BASE_NAMESPACE_BEGIN_DECL
4 | CSockAcceptor::CSockAcceptor()
5 | {
6 |
7 | }
8 |
9 | CSockAcceptor::~CSockAcceptor()
10 | {
11 | sock_stream_.close();
12 | }
13 |
14 | BASE_HANDLER CSockAcceptor::get_socket_handler() const
15 | {
16 | return sock_stream_.get_handler();
17 | }
18 |
19 | int32_t CSockAcceptor::open(const BASEOBJECT::Inet_Addr &addr, bool nonblocking, int32_t listen_max)
20 | {
21 | if(sock_stream_.open(addr, nonblocking) == -1)
22 | return -1;
23 |
24 | int32_t ret = ::listen(sock_stream_.get_handler(), listen_max);
25 | if(ret != 0)
26 | {
27 | sock_stream_.close();
28 | return -1;
29 | }
30 |
31 | return 0;
32 | }
33 |
34 | int32_t CSockAcceptor::close()
35 | {
36 | return sock_stream_.close();
37 | }
38 |
39 | int32_t CSockAcceptor::accept(CSockStream& new_stream, Inet_Addr &remote_addr, bool nonblocking)
40 | {
41 | sockaddr_in addr;
42 | #ifdef WIN32
43 | int32_t addr_len = sizeof(addr);
44 | #else
45 | uint32_t addr_len = sizeof(addr);
46 | #endif
47 |
48 | BASE_HANDLER new_socket = ::accept(get_socket_handler(),(sockaddr *)&addr, &addr_len);
49 | if(new_socket == INVALID_HANDLER)
50 | {
51 | return -1;
52 | }
53 |
54 | if(nonblocking)
55 | {
56 | set_socket_nonblocking(new_socket);
57 | }
58 |
59 | new_stream.set_handler(new_socket);
60 | remote_addr = addr;
61 |
62 | return 0;
63 | }
64 |
65 | int32_t CSockAcceptor::get_local_addr(Inet_Addr& local_addr) const
66 | {
67 | return sock_stream_.get_local_addr(local_addr);
68 | }
69 |
70 | BASE_NAMESPACE_END_DECL
71 |
--------------------------------------------------------------------------------
/common/revolver/base_sock_acceptor.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_sock_acceptor.h
--------------------------------------------------------------------------------
/common/revolver/base_sock_connector.cpp:
--------------------------------------------------------------------------------
1 | #include "base_sock_connector.h"
2 |
3 | BASE_NAMESPACE_BEGIN_DECL
4 | CSockConnector::CSockConnector()
5 | {
6 |
7 | }
8 |
9 | CSockConnector::~CSockConnector()
10 | {
11 |
12 | }
13 |
14 | int32_t CSockConnector::connect(CSockStream &sock_stream, const Inet_Addr &remote_addr)
15 | {
16 | if(remote_addr.is_null())
17 | {
18 | return -1;
19 | }
20 |
21 | remote_addr_ = remote_addr;
22 |
23 | int32_t ret = ::connect(sock_stream.get_handler(), (struct sockaddr *)remote_addr_.get_addr(), sizeof(sockaddr_in));
24 | if(ret != 0 && error_no() != XEINPROGRESS)
25 | {
26 | return -1;
27 | }
28 |
29 | return 0;
30 | }
31 | BASE_NAMESPACE_END_DECL
32 |
--------------------------------------------------------------------------------
/common/revolver/base_sock_connector.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_sock_connector.h
--------------------------------------------------------------------------------
/common/revolver/base_sock_dgram.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_sock_dgram.cpp
--------------------------------------------------------------------------------
/common/revolver/base_sock_dgram.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_sock_dgram.h
--------------------------------------------------------------------------------
/common/revolver/base_sock_stream.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_sock_stream.cpp
--------------------------------------------------------------------------------
/common/revolver/base_sock_stream.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_sock_stream.h
--------------------------------------------------------------------------------
/common/revolver/base_socket.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_socket.h
--------------------------------------------------------------------------------
/common/revolver/base_thread.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_thread.h
--------------------------------------------------------------------------------
/common/revolver/base_thread_mutex.h:
--------------------------------------------------------------------------------
1 | #ifndef __BASE_THREAD_MUTEX_H
2 | #define __BASE_THREAD_MUTEX_H
3 |
4 | #include "revolver/base_namespace.h"
5 |
6 | #if defined(WIN32) | defined(_WIN32) | defined(_WIN64)
7 |
8 | #if _WIN32_WINNT < 0x0502
9 | #define _WIN32_WINNT 0x0502
10 | #endif
11 |
12 | #include
13 | #include
14 | #include
15 |
16 | BASE_NAMESPACE_BEGIN_DECL
17 |
18 | class BaseThreadMutex
19 | {
20 | public:
21 | BaseThreadMutex()
22 | {
23 | InitializeCriticalSection(§ion_);
24 | };
25 |
26 | ~BaseThreadMutex()
27 | {
28 | DeleteCriticalSection(§ion_);
29 | };
30 |
31 | void acquire()
32 | {
33 | EnterCriticalSection(§ion_);
34 | };
35 |
36 | bool try_acquire()
37 | {
38 | return (TryEnterCriticalSection(§ion_) != FALSE) ? true : false;
39 | };
40 |
41 | void release()
42 | {
43 | LeaveCriticalSection(§ion_);
44 | };
45 |
46 | private:
47 | CRITICAL_SECTION section_;
48 | };
49 |
50 | BASE_NAMESPACE_END_DECL;
51 | #else
52 | #include
53 |
54 | BASE_NAMESPACE_BEGIN_DECL
55 | class BaseThreadMutex
56 | {
57 | public:
58 | BaseThreadMutex()
59 | {
60 | pthread_mutexattr_t mutex_a;
61 | pthread_mutexattr_init(&mutex_a);
62 | pthread_mutexattr_settype(&mutex_a, PTHREAD_MUTEX_RECURSIVE);
63 |
64 | pthread_mutex_init(&mutex_, &mutex_a);
65 | pthread_mutexattr_destroy(&mutex_a);
66 | };
67 |
68 | ~BaseThreadMutex()
69 | {
70 | pthread_mutex_destroy(&mutex_);
71 | };
72 |
73 | void acquire()
74 | {
75 | pthread_mutex_lock(&mutex_);
76 | }
77 |
78 | bool try_acquire()
79 | {
80 | return pthread_mutex_trylock(&mutex_) == 0 ? true : false;
81 | }
82 |
83 | void release()
84 | {
85 | pthread_mutex_unlock(&mutex_);
86 | }
87 |
88 | private:
89 | pthread_mutex_t mutex_;
90 | };
91 | BASE_NAMESPACE_END_DECL;
92 | #endif
93 |
94 | #endif
95 |
--------------------------------------------------------------------------------
/common/revolver/base_timer_value.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_timer_value.h
--------------------------------------------------------------------------------
/common/revolver/base_typedef.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/base_typedef.h
--------------------------------------------------------------------------------
/common/revolver/crc_crypt.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/crc_crypt.c
--------------------------------------------------------------------------------
/common/revolver/crc_crypt.h:
--------------------------------------------------------------------------------
1 | #ifndef __CRC_CRYPT_H
2 | #define __CRC_CRYPT_H
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | #include "revolver/aes.h"
9 |
10 | aes_context* create_crypt(unsigned char* _ekey, int _ebits);
11 | void destroy_crypt(aes_context* context);
12 |
13 | int encrypt(aes_context* handler, unsigned char* src, int src_size, unsigned char* dst);
14 | int decrypt(aes_context* handler, unsigned char* src, int src_size, unsigned char* dst);
15 |
16 | #ifdef __cplusplus
17 | }
18 | #endif
19 |
20 | #endif
21 |
--------------------------------------------------------------------------------
/common/revolver/date_time.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/date_time.cpp
--------------------------------------------------------------------------------
/common/revolver/date_time.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/date_time.h
--------------------------------------------------------------------------------
/common/revolver/gettimeofday.cpp:
--------------------------------------------------------------------------------
1 | #ifdef WIN32
2 | #include
3 | /*
4 | * Number of micro-seconds between the beginning of the Windows epoch
5 | * (Jan. 1, 1601) and the Unix epoch (Jan. 1, 1970).
6 | *
7 | * This assumes all Win32 compilers have 64-bit support.
8 | */
9 | #if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) || defined(__WATCOMC__)
10 | #define DELTA_EPOCH_IN_USEC 11644473600000000Ui64
11 | #else
12 | #define DELTA_EPOCH_IN_USEC 11644473600000000ULL
13 | #endif
14 |
15 | typedef unsigned __int64 u_int64_t;
16 |
17 | static u_int64_t filetime_to_unix_epoch (const FILETIME *ft)
18 | {
19 | u_int64_t res = (u_int64_t) ft->dwHighDateTime << 32;
20 |
21 | res |= ft->dwLowDateTime;
22 | res /= 10; /* from 100 nano-sec periods to usec */
23 | res -= DELTA_EPOCH_IN_USEC; /* from Win epoch to Unix epoch */
24 | return (res);
25 | }
26 |
27 | int gettimeofday (struct timeval *tv, void *tz)
28 | {
29 | FILETIME ft;
30 | u_int64_t tim;
31 |
32 | if (!tv) {
33 | //errno = EINVAL;
34 | return (-1);
35 | }
36 | ::GetSystemTimeAsFileTime (&ft);
37 | tim = filetime_to_unix_epoch (&ft);
38 | tv->tv_sec = (long) (tim / 1000000L);
39 | tv->tv_usec = (long) (tim % 1000000L);
40 | return (0);
41 | }
42 | #endif
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/common/revolver/gettimeofday.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/gettimeofday.h
--------------------------------------------------------------------------------
/common/revolver/lzo_object.cpp:
--------------------------------------------------------------------------------
1 | #include "minilzo.h"
2 | #include "lzo_object.h"
3 |
4 | #include
5 |
6 | using namespace std;
7 |
8 | BASE_NAMESPACE_BEGIN_DECL
9 |
10 | BaseLZObject::BaseLZObject() : wrkmem_(NULL), init_flag_(false)
11 | {
12 | init();
13 | }
14 |
15 | BaseLZObject::~BaseLZObject()
16 | {
17 | destroy();
18 | }
19 |
20 | void BaseLZObject::init()
21 | {
22 | if (lzo_init() != LZO_E_OK)
23 | {
24 | cout << "internal error - lzo_init() failed !!!" << endl;
25 | return ;
26 | }
27 |
28 | init_flag_ = true;
29 |
30 | if(wrkmem_ == NULL)
31 | {
32 | wrkmem_ = new uint8_t[LZO_VMEM_SISE];
33 | }
34 | }
35 |
36 | void BaseLZObject::destroy()
37 | {
38 | if(wrkmem_ != NULL)
39 | {
40 | delete []wrkmem_;
41 | wrkmem_ = NULL;
42 | };
43 | }
44 |
45 | int32_t BaseLZObject::compress(const uint8_t* src, uint32_t src_size, uint8_t *dst, uint32_t& dst_size)
46 | {
47 | if(wrkmem_ == NULL || !init_flag_)
48 | return -1;
49 |
50 | int32_t ret = -1;
51 | try{
52 | lzo_uint out_size = dst_size;
53 | ret = lzo1x_1_compress(src, src_size, dst, &out_size, wrkmem_);
54 | if(out_size >= src_size)
55 | return -1;
56 |
57 | dst_size = out_size;
58 | }
59 | catch(...)
60 | {
61 | cout << "lzo1x_1_compress crach!!" << endl;
62 | return -1;
63 | }
64 |
65 | return ret;
66 | }
67 |
68 | int32_t BaseLZObject::uncompress(const uint8_t* src, uint32_t src_size, uint8_t *dst, uint32_t& dst_size)
69 | {
70 | if(!init_flag_)
71 | return -1;
72 |
73 | int32_t ret = -1;
74 | try{
75 | lzo_uint out_size = dst_size;
76 | ret = lzo1x_decompress(src, src_size, dst, &out_size, NULL);
77 | if(ret == LZO_E_OK)
78 | dst_size = out_size;
79 | }
80 | catch(...)
81 | {
82 | cout << "lzo1x_decompress crach!!" << endl;
83 | return -1;
84 | }
85 |
86 | return ret;
87 | }
88 |
89 | BASE_NAMESPACE_END_DECL
90 |
91 |
--------------------------------------------------------------------------------
/common/revolver/lzo_object.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/lzo_object.h
--------------------------------------------------------------------------------
/common/revolver/md5.h:
--------------------------------------------------------------------------------
1 | /*
2 | * md5.h Structures and prototypes for md5.
3 | *
4 | * Version: $Id: md5.h,v 1.3 2006/06/30 01:28:16 cvsroot Exp $
5 | * License: LGPL, but largely derived from a public domain source.
6 | *
7 | */
8 | #ifdef __cplusplus
9 | extern "C" {
10 | #endif
11 |
12 |
13 | #ifndef _LRAD_MD5_H
14 | #define _LRAD_MD5_H
15 |
16 |
17 | void librad_md5_calc(unsigned char *output, unsigned char *input,unsigned int inputlen);
18 |
19 | /*
20 | * FreeRADIUS defines to ensure globally unique MD5 function names,
21 | * so that we don't pick up vendor-specific broken MD5 libraries.
22 | */
23 | #define MD5_CTX librad_MD5_CTX
24 | #define MD5Init librad_MD5Init
25 | #define MD5Update librad_MD5Update
26 | #define MD5Final librad_MD5Final
27 | #define MD5Transform librad_MD5Transform
28 | #define MD5_BLOCK_LENGTH 64
29 | #define MD5_DIGEST_LENGTH 16
30 |
31 | typedef unsigned int uint32_t;
32 | typedef unsigned char uint8_t;
33 |
34 | typedef struct MD5Context {
35 | uint32_t state[4]; /* state */
36 | uint32_t count[2]; /* number of bits, mod 2^64 */
37 | uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */
38 | } MD5_CTX;
39 |
40 | /* include */
41 |
42 | /* __BEGIN_DECLS */
43 | void MD5Init(MD5_CTX *);
44 | void MD5Update(MD5_CTX *, const uint8_t *, size_t)
45 | /* __attribute__((__bounded__(__string__,2,3)))*/;
46 | void MD5Final(uint8_t [MD5_DIGEST_LENGTH], MD5_CTX *)
47 | /* __attribute__((__bounded__(__minbytes__,1,MD5_DIGEST_LENGTH)))*/;
48 | void MD5Transform(uint32_t [4], const uint8_t [MD5_BLOCK_LENGTH])
49 | /* __attribute__((__bounded__(__minbytes__,1,4)))*/
50 | /* __attribute__((__bounded__(__minbytes__,2,MD5_BLOCK_LENGTH)))*/;
51 | /* __END_DECLS */
52 |
53 | #endif /* _LRAD_MD5_H */
54 |
55 |
56 | #ifdef __cplusplus
57 | }
58 | #endif
59 |
60 |
--------------------------------------------------------------------------------
/common/revolver/object_pool.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/object_pool.h
--------------------------------------------------------------------------------
/common/revolver/revolver.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/common/revolver/timer_node_t.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/timer_node_t.h
--------------------------------------------------------------------------------
/common/revolver/timer_node_t.inl:
--------------------------------------------------------------------------------
1 | BASE_NAMESPACE_BEGIN_DECL
2 |
3 | #define FIRST_ROUND 16777216
4 | #define SECOND_ROUND 65536
5 | #define THIRD_ROUND 256
6 |
7 | template
8 | BaseTimerNode_T::BaseTimerNode_T(void)
9 | : act_(NULL), timer_id_(0xffffffff)
10 | , timeout_stamp_(0), internal_(0), handler_(0)
11 | {
12 |
13 | }
14 |
15 | template
16 | BaseTimerNode_T::~BaseTimerNode_T(void)
17 | {
18 |
19 | }
20 |
21 | template
22 | void BaseTimerNode_T::set(HANDLER handler, const void* act,
23 | uint32_t timeout_stamp, uint32_t intval, uint32_t timer_id)
24 | {
25 | handler_ = handler;
26 | act_ = act;
27 | timeout_stamp_ = timeout_stamp;
28 | internal_ = intval;
29 | timer_id_ = timer_id;
30 | }
31 |
32 | template
33 | void BaseTimerNode_T::get_dispatch_info(BaseTimerDispathInfo_T &info)
34 | {
35 | info.act_ = act_;
36 | info.handler_ = handler_;
37 | info.recurring_ = internal_ > 0 ? true : false;
38 | }
39 |
40 | template
41 | void BaseTimerNode_T::get_revolver_pos(uint8_t& first, uint8_t &second, uint8_t& third, uint8_t& fourth) const
42 | {
43 | first = (uint8_t)(timeout_stamp_ / FIRST_ROUND);
44 | second = (uint8_t)((timeout_stamp_ % FIRST_ROUND) / SECOND_ROUND);
45 | third = (uint8_t)((timeout_stamp_ % SECOND_ROUND) / THIRD_ROUND);
46 | fourth = (uint8_t) (timeout_stamp_ % THIRD_ROUND);
47 | }
48 | BASE_NAMESPACE_END_DECL
49 |
--------------------------------------------------------------------------------
/common/revolver/timer_queue_t.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/timer_queue_t.h
--------------------------------------------------------------------------------
/common/revolver/timer_queue_t.inl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/timer_queue_t.inl
--------------------------------------------------------------------------------
/common/revolver/timer_ring.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/timer_ring.cpp
--------------------------------------------------------------------------------
/common/revolver/timer_ring.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/revolver/timer_ring.h
--------------------------------------------------------------------------------
/common/rudp/ReadMe.txt:
--------------------------------------------------------------------------------
1 | ========================================================================
2 | STATIC LIBRARY : rudp Project Overview
3 | ========================================================================
4 |
5 | AppWizard has created this rudp library project for you.
6 |
7 | No source files were created as part of your project.
8 |
9 |
10 | rudp.vcxproj
11 | This is the main project file for VC++ projects generated using an Application Wizard.
12 | It contains information about the version of Visual C++ that generated the file, and
13 | information about the platforms, configurations, and project features selected with the
14 | Application Wizard.
15 |
16 | rudp.vcxproj.filters
17 | This is the filters file for VC++ projects generated using an Application Wizard.
18 | It contains information about the association between the files in your project
19 | and the filters. This association is used in the IDE to show grouping of files with
20 | similar extensions under a specific node (for e.g. ".cpp" files are associated with the
21 | "Source Files" filter).
22 |
23 | /////////////////////////////////////////////////////////////////////////////
24 | Other notes:
25 |
26 | AppWizard uses "TODO:" comments to indicate parts of the source code you
27 | should add to or customize.
28 |
29 | /////////////////////////////////////////////////////////////////////////////
30 |
--------------------------------------------------------------------------------
/common/rudp/rudp.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/common/rudp/rudp_acceptor.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_acceptor.h
--------------------------------------------------------------------------------
/common/rudp/rudp_adapter.cpp:
--------------------------------------------------------------------------------
1 | #include "rudp/rudp_adapter.h"
2 | #include "rudp/rudp_interface.h"
3 |
4 | BASE_NAMESPACE_BEGIN_DECL
5 |
6 | void IRUDPAdapter::on_data(BinStream& strm, const Inet_Addr& remote_addr)
7 | {
8 | RUDP()->process(this, strm, remote_addr);
9 | }
10 |
11 | BASE_NAMESPACE_END_DECL
--------------------------------------------------------------------------------
/common/rudp/rudp_adapter.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_adapter.h
--------------------------------------------------------------------------------
/common/rudp/rudp_adapter_interface.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_adapter_interface.h
--------------------------------------------------------------------------------
/common/rudp/rudp_ccc.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_ccc.cpp
--------------------------------------------------------------------------------
/common/rudp/rudp_ccc.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_ccc.h
--------------------------------------------------------------------------------
/common/rudp/rudp_channel_interface.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_channel_interface.h
--------------------------------------------------------------------------------
/common/rudp/rudp_event_handler.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_event_handler.h
--------------------------------------------------------------------------------
/common/rudp/rudp_half_connection.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_half_connection.h
--------------------------------------------------------------------------------
/common/rudp/rudp_interface.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_interface.cpp
--------------------------------------------------------------------------------
/common/rudp/rudp_interface.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_interface.h
--------------------------------------------------------------------------------
/common/rudp/rudp_log_macro.cpp:
--------------------------------------------------------------------------------
1 | #include "rudp/rudp_log_macro.h"
2 |
3 | SingleLogStream rdup_log("rudp", SingleLogStream::debug);
4 | SingleLogStream rdup_recv_log("rudp_recv", SingleLogStream::debug);
5 | SingleLogStream rdup_send_log("rudp_send", SingleLogStream::debug);
--------------------------------------------------------------------------------
/common/rudp/rudp_log_macro.h:
--------------------------------------------------------------------------------
1 | #ifndef __RDUP_LOG_MACRO_H_
2 | #define __RDUP_LOG_MACRO_H_
3 |
4 | #include "revolver/base_log.h"
5 | #include "revolver/base_hex_string.h"
6 |
7 | extern SingleLogStream rdup_log;
8 | extern SingleLogStream rdup_recv_log;
9 | extern SingleLogStream rdup_send_log;
10 |
11 | #define RUDP_DEBUG(arg)\
12 | DEBUG_TRACE(rdup_log, arg)
13 |
14 | #define RUDP_INFO(arg)\
15 | INFO_TRACE(rdup_log, arg)
16 |
17 | #define RUDP_WARNING(arg)\
18 | WARNING_TRACE(rdup_log, arg)
19 |
20 | #define RUDP_ERROR(arg)\
21 | ERROR_TRACE(rdup_log, arg)
22 |
23 | #define RUDP_FATAL(arg)\
24 | FATAL_TRACE(rdup_log, arg)
25 |
26 | #define SET_RUDP_LEVEL(arg)\
27 | rdup_log.set_trace_level(arg)
28 |
29 |
30 | #define RUDP_RECV_DEBUG(arg)\
31 | DEBUG_TRACE(rdup_recv_log, arg)
32 |
33 | #define RUDP_RECV_INFO(arg)\
34 | INFO_TRACE(rdup_recv_log, arg)
35 |
36 | #define RUDP_RECV_WARNING(arg)\
37 | WARNING_TRACE(rdup_recv_log, arg)
38 |
39 | #define RUDP_RECV_ERROR(arg)\
40 | ERROR_TRACE(rdup_recv_log, arg)
41 |
42 | #define RUDP_RECV_FATAL(arg)\
43 | FATAL_TRACE(rdup_recv_log, arg)
44 |
45 | #define SET_RUDP_RECV_LEVEL(arg)\
46 | rdup_recv_log.set_trace_level(arg)
47 |
48 |
49 | #define RUDP_SEND_DEBUG(arg)\
50 | DEBUG_TRACE(rdup_send_log, arg)
51 |
52 | #define RUDP_SEND_INFO(arg)\
53 | INFO_TRACE(rdup_send_log, arg)
54 |
55 | #define RUDP_SEND_WARNING(arg)\
56 | WARNING_TRACE(rdup_send_log, arg)
57 |
58 | #define RUDP_SEND_ERROR(arg)\
59 | ERROR_TRACE(rdup_send_log, arg)
60 |
61 | #define RUDP_SEND_FATAL(arg)\
62 | FATAL_TRACE(rdup_send_log, arg)
63 |
64 | #define SET_RUDP_SEND_LEVEL(arg)\
65 | rdup_send_log.set_trace_level(arg)
66 |
67 | #endif
68 |
--------------------------------------------------------------------------------
/common/rudp/rudp_packet.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_packet.h
--------------------------------------------------------------------------------
/common/rudp/rudp_recv_buffer.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_recv_buffer.cpp
--------------------------------------------------------------------------------
/common/rudp/rudp_recv_buffer.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_recv_buffer.h
--------------------------------------------------------------------------------
/common/rudp/rudp_segment.cpp:
--------------------------------------------------------------------------------
1 | #include "rudp/rudp_segment.h"
2 |
3 | BASE_NAMESPACE_BEGIN_DECL
4 |
5 | ObjectPool SENDSEGPOOL;
6 | ObjectPool RECVSEGPOOL;
7 |
8 | BASE_NAMESPACE_END_DECL
--------------------------------------------------------------------------------
/common/rudp/rudp_segment.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_segment.h
--------------------------------------------------------------------------------
/common/rudp/rudp_send_buffer.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_send_buffer.cpp
--------------------------------------------------------------------------------
/common/rudp/rudp_send_buffer.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_send_buffer.h
--------------------------------------------------------------------------------
/common/rudp/rudp_socket.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_socket.cpp
--------------------------------------------------------------------------------
/common/rudp/rudp_socket.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_socket.h
--------------------------------------------------------------------------------
/common/rudp/rudp_stream.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_stream.cpp
--------------------------------------------------------------------------------
/common/rudp/rudp_stream.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/rudp/rudp_stream.h
--------------------------------------------------------------------------------
/common/silencer/ReadMe.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/silencer/ReadMe.txt
--------------------------------------------------------------------------------
/common/silencer/daemon_config.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/silencer/daemon_config.cpp
--------------------------------------------------------------------------------
/common/silencer/daemon_config.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/silencer/daemon_config.h
--------------------------------------------------------------------------------
/common/silencer/dc_tcp_listener.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/silencer/dc_tcp_listener.cpp
--------------------------------------------------------------------------------
/common/silencer/dc_tcp_listener.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/silencer/dc_tcp_listener.h
--------------------------------------------------------------------------------
/common/silencer/sil_connection_hash.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/common/silencer/sil_connection_hash.h
--------------------------------------------------------------------------------
/common/silencer/silencer.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | Header Files
23 |
24 |
25 | Header Files
26 |
27 |
28 | Header Files
29 |
30 |
31 |
32 |
33 | Source Files
34 |
35 |
36 | Source Files
37 |
38 |
39 |
--------------------------------------------------------------------------------
/common/silencer/silencer.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/common/vsproj/silencer_v12.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 |
14 |
15 | Header Files
16 |
17 |
18 | Header Files
19 |
20 |
21 | Header Files
22 |
23 |
24 |
25 |
26 | Source Files
27 |
28 |
29 | Source Files
30 |
31 |
32 |
--------------------------------------------------------------------------------
/daemon/daemon.cpp:
--------------------------------------------------------------------------------
1 | // daemon.cpp : Defines the entry point for the console application.
2 | //
3 |
4 | #include "daemon_frame.h"
5 | #include "core/core_main.h"
6 |
7 | int main(int argc, char* argv[])
8 | {
9 | CREATE_DAEMON_FRAME();
10 |
11 | DAEMON_FRAME()->init();
12 | DAEMON_FRAME()->start();
13 |
14 | core_main();
15 |
16 | DAEMON_FRAME()->destroy();
17 |
18 | DESTROY_DAEMON_FRAME();
19 |
20 | return 0;
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/daemon/daemon.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "daemon", "daemon.vcxproj", "{B5026BD0-9443-42DD-996D-29434E1B0953}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Win32 = Debug|Win32
9 | Release|Win32 = Release|Win32
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {B5026BD0-9443-42DD-996D-29434E1B0953}.Debug|Win32.ActiveCfg = Debug|Win32
13 | {B5026BD0-9443-42DD-996D-29434E1B0953}.Debug|Win32.Build.0 = Debug|Win32
14 | {B5026BD0-9443-42DD-996D-29434E1B0953}.Release|Win32.ActiveCfg = Release|Win32
15 | {B5026BD0-9443-42DD-996D-29434E1B0953}.Release|Win32.Build.0 = Release|Win32
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/daemon/daemon.sln.docstates.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon.sln.docstates.suo
--------------------------------------------------------------------------------
/daemon/daemon.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon.suo
--------------------------------------------------------------------------------
/daemon/daemon.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 | Source Files
32 |
33 |
34 | Source Files
35 |
36 |
37 |
38 |
39 | Header Files
40 |
41 |
42 | Header Files
43 |
44 |
45 | Header Files
46 |
47 |
48 | Header Files
49 |
50 |
51 | Header Files
52 |
53 |
54 | Header Files
55 |
56 |
57 | Header Files
58 |
59 |
60 |
--------------------------------------------------------------------------------
/daemon/daemon.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/daemon/daemon_element.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/yuanrongxi/innodb/33247920feb5e7373e00a1198550ff8382e26983/daemon/daemon_element.cpp
--------------------------------------------------------------------------------
/daemon/daemon_element.h:
--------------------------------------------------------------------------------
1 | #ifndef __DAEMON_ELEMENT_H
2 | #define __DAEMON_ELEMENT_H
3 |
4 | #include "revolver/base_namespace.h"
5 | #include "revolver/base_typedef.h"
6 | #include "revolver/base_inet_addr.h"
7 |
8 | #include