2019-07-28 10:31:56 +08:00
|
|
|
|
// http_server.cpp : <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨Ӧ<CCA8>ó<EFBFBD><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ㡣
|
2014-11-19 00:25:21 +08:00
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include "rpc_manager.h"
|
|
|
|
|
#include "rpc_stats.h"
|
|
|
|
|
#include "http_rpc.h"
|
|
|
|
|
|
|
|
|
|
static int var_data_size = 1024;
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD>첽<EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
class handle_io : public aio_callback
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
handle_io(aio_socket_stream* client)
|
|
|
|
|
: client_(client)
|
|
|
|
|
{
|
|
|
|
|
http_ = new http_rpc(client_, (unsigned) var_data_size);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
~handle_io()
|
|
|
|
|
{
|
|
|
|
|
delete http_;
|
2015-02-07 22:55:24 +08:00
|
|
|
|
printf("delete io_callback now ...\r\n");
|
2014-11-19 00:25:21 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool write_callback()
|
|
|
|
|
{
|
|
|
|
|
return (true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* ʵ<EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD>麯<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD>ʱ<EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
void close_callback()
|
|
|
|
|
{
|
2015-02-07 22:55:24 +08:00
|
|
|
|
printf("Closed now.\r\n");
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ڴ˴<DAB4>ɾ<EFBFBD><C9BE><EFBFBD>ö<EFBFBD>̬<EFBFBD><CCAC><EFBFBD><EFBFBD><EFBFBD>Ļص<C4BB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Է<EFBFBD>ֹ<EFBFBD>ڴ<EFBFBD>й¶
|
2014-11-19 00:25:21 +08:00
|
|
|
|
delete this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* ʵ<EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><EFBFBD>麯<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ij<EFBFBD>ʱ<EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> true <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϣ<EFBFBD><EFBFBD><EFBFBD>رո<EFBFBD><EFBFBD>첽<EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool timeout_callback()
|
|
|
|
|
{
|
2015-02-07 22:55:24 +08:00
|
|
|
|
printf("Timeout ...\r\n");
|
2014-11-19 00:25:21 +08:00
|
|
|
|
return (false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual bool read_wakeup()
|
|
|
|
|
{
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD>״̬
|
2014-11-19 00:25:21 +08:00
|
|
|
|
rpc_read_wait_del();
|
|
|
|
|
rpc_add();
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD>Ը<EFBFBD><D4B8>첽<EFBFBD><ECB2BD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
client_->disable_read();
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD>һ<EFBFBD><D2BB> http <20>Ự<EFBFBD><E1BBB0><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
rpc_manager::get_instance().fork(http_);
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
aio_socket_stream* client_;
|
|
|
|
|
http_rpc* http_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD>첽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
class handle_accept : public aio_accept_callback
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
handle_accept(bool preread)
|
|
|
|
|
: preread_(preread)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
~handle_accept()
|
|
|
|
|
{
|
|
|
|
|
printf(">>io_accept_callback over!\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>麯<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ô˻ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @param client {aio_socket_stream*} <EFBFBD>첽<EFBFBD>ͻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> true <EFBFBD><EFBFBD>֪ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
*/
|
|
|
|
|
bool accept_callback(acl::aio_socket_stream* client)
|
|
|
|
|
{
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߳<EFBFBD><DFB3><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>־λ
|
2014-11-19 00:25:21 +08:00
|
|
|
|
if (preread_)
|
|
|
|
|
{
|
|
|
|
|
ACL_VSTREAM* vstream = client->get_vstream();
|
|
|
|
|
vstream->flag |= ACL_VSTREAM_FLAG_PREREAD;
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>첽<EFBFBD>ͻ<EFBFBD><CDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļص<C4BB><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD>а<EFBFBD><D0B0><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
handle_io* callback = new handle_io(client);
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// ע<><D7A2><EFBFBD>첽<EFBFBD><ECB2BD><EFBFBD>Ķ<EFBFBD><C4B6>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
client->add_read_callback(callback);
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// ע<><D7A2><EFBFBD>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD>д<EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
client->add_write_callback(callback);
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// ע<><D7A2><EFBFBD>첽<EFBFBD><ECB2BD><EFBFBD>Ĺرջص<D5BB><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
client->add_close_callback(callback);
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// ע<><D7A2><EFBFBD>첽<EFBFBD><ECB2BD><EFBFBD>ij<EFBFBD>ʱ<EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
client->add_timeout_callback(callback);
|
|
|
|
|
|
|
|
|
|
rpc_read_wait_add();
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>첽<EFBFBD><ECB2BD><EFBFBD>Ƿ<EFBFBD><C7B7>ɶ<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
client->read_wait(10);
|
|
|
|
|
|
|
|
|
|
return (true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
bool preread_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void usage(const char* procname)
|
|
|
|
|
{
|
|
|
|
|
printf("usage: %s \r\n"
|
|
|
|
|
" -h[help]\r\n"
|
|
|
|
|
" -p[preread in main thread]\r\n"
|
|
|
|
|
" -l listen_addr[127.0.0.1:9001]\r\n"
|
|
|
|
|
" -m[use mempool]\r\n"
|
|
|
|
|
" -k[use kernel engine]\r\n"
|
|
|
|
|
" -n data size response\r\n"
|
|
|
|
|
" -N thread pool limit\r\n"
|
|
|
|
|
" -r rpc_addr\r\n"
|
|
|
|
|
" -v[enable stdout]\r\n", procname);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main(int argc, char* argv[])
|
|
|
|
|
{
|
|
|
|
|
#ifdef WIN32
|
|
|
|
|
acl_cpp_init();
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
bool preread = false;
|
|
|
|
|
char addr[32], rpc_addr[32], ch;
|
|
|
|
|
bool use_mempool = false;
|
|
|
|
|
bool use_kernel = false;
|
|
|
|
|
bool enable_stdout = false;
|
|
|
|
|
int nthreads = 20;
|
|
|
|
|
|
2015-01-04 22:51:01 +08:00
|
|
|
|
acl::safe_snprintf(addr, sizeof(addr), "127.0.0.1:9001");
|
|
|
|
|
acl::safe_snprintf(rpc_addr, sizeof(rpc_addr), "127.0.0.1:0");
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
while ((ch = getopt(argc, argv, "vkhpms:n:N:r:")) > 0)
|
|
|
|
|
{
|
|
|
|
|
switch (ch)
|
|
|
|
|
{
|
|
|
|
|
case 'h':
|
|
|
|
|
usage(argv[0]);
|
|
|
|
|
return 0;
|
|
|
|
|
case 's':
|
2015-01-04 22:51:01 +08:00
|
|
|
|
acl::safe_snprintf(addr, sizeof(addr), "%s", optarg);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
break;
|
|
|
|
|
case 'p':
|
|
|
|
|
preread = true;
|
|
|
|
|
break;
|
|
|
|
|
case 'm':
|
|
|
|
|
use_mempool = true;
|
|
|
|
|
break;
|
|
|
|
|
case 'k':
|
|
|
|
|
use_kernel = true;
|
|
|
|
|
break;
|
|
|
|
|
case 'n':
|
|
|
|
|
var_data_size = atoi(optarg);
|
|
|
|
|
if (var_data_size <= 0)
|
|
|
|
|
var_data_size = 1024;
|
|
|
|
|
break;
|
|
|
|
|
case 'N':
|
|
|
|
|
nthreads = atoi(optarg);
|
|
|
|
|
if (nthreads <= 0)
|
|
|
|
|
nthreads = 10;
|
|
|
|
|
break;
|
|
|
|
|
case 'v':
|
|
|
|
|
enable_stdout = true;
|
|
|
|
|
break;
|
|
|
|
|
case 'r':
|
2015-01-04 22:51:01 +08:00
|
|
|
|
acl::safe_snprintf(rpc_addr, sizeof(rpc_addr), "%s", optarg);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֲ߳̾<CCBE><D6B2>ڴ<EFBFBD><DAB4><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
if (use_mempool)
|
|
|
|
|
acl_mem_slice_init(8, 1024, 100000,
|
|
|
|
|
ACL_SLICE_FLAG_GC2 |
|
|
|
|
|
ACL_SLICE_FLAG_RTGC_OFF |
|
|
|
|
|
ACL_SLICE_FLAG_LP64_ALIGN);
|
|
|
|
|
|
|
|
|
|
rpc_stats_init();
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ
|
2014-11-19 00:25:21 +08:00
|
|
|
|
if (enable_stdout)
|
|
|
|
|
log::stdout_open(true);
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20>첽ͨ<ECB2BD>ſ<EFBFBD><C5BF>ܾ<EFBFBD><DCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> select ϵͳ api
|
2014-11-19 00:25:21 +08:00
|
|
|
|
aio_handle* handle = new aio_handle(use_kernel ? ENGINE_KERNEL : ENGINE_SELECT);
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>첽<EFBFBD><ECB2BD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
aio_listen_stream* sstream = new aio_listen_stream(handle);
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD>ĵ<EFBFBD>ַ
|
2014-11-19 00:25:21 +08:00
|
|
|
|
if (sstream->open(addr) == false)
|
|
|
|
|
{
|
2015-02-07 22:55:24 +08:00
|
|
|
|
printf("open %s error!\r\n", addr);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
sstream->close();
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// XXX: Ϊ<>˱<EFBFBD>֤<EFBFBD>ܹرռ<D8B1><D5BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ڴ˴<DAB4><CBB4><EFBFBD> check һ<><D2BB>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
handle->check();
|
|
|
|
|
#ifdef WIN32
|
|
|
|
|
getchar();
|
|
|
|
|
#endif
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><>ʼ<EFBFBD><CABC><EFBFBD>첽 RPC ͨ<>ŷ<EFBFBD><C5B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
rpc_manager::get_instance().init(handle, nthreads, rpc_addr);
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3A3ACB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD>ʱ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD>ô<EFBFBD><C3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļص<C4BB><D8B5><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
handle_accept callback(preread);
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD>ص<EFBFBD><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>첽<EFBFBD><ECB2BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
sstream->add_accept_callback(&callback);
|
|
|
|
|
|
2015-02-07 22:55:24 +08:00
|
|
|
|
printf("Listen: %s ok!\r\n", addr);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
|
|
|
|
time_t last = time(NULL), now;
|
|
|
|
|
while (true)
|
|
|
|
|
{
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> false <20><><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>ټ<EFBFBD><D9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>˳<EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
if (handle->check() == false)
|
|
|
|
|
{
|
2015-02-07 22:55:24 +08:00
|
|
|
|
printf("aio_server stop now ...\r\n");
|
2014-11-19 00:25:21 +08:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
time(&now);
|
|
|
|
|
if (now - last >= 1)
|
|
|
|
|
{
|
|
|
|
|
printf("\r\n------------------------------\r\n");
|
2019-07-28 10:31:56 +08:00
|
|
|
|
rpc_out(); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ rpc <20><><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
rpc_req_out();
|
|
|
|
|
rpc_read_wait_out();
|
|
|
|
|
last = now;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20>رռ<D8B1><D5BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
sstream->close();
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// <20>ر<EFBFBD> RPC <20><><EFBFBD><EFBFBD>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
rpc_manager::get_instance().finish();
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// XXX: Ϊ<>˱<EFBFBD>֤<EFBFBD>ܹرռ<D8B1><D5BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD>ڴ˴<DAB4><CBB4><EFBFBD> check һ<><D2BB>
|
2014-11-19 00:25:21 +08:00
|
|
|
|
handle->check();
|
|
|
|
|
delete handle;
|
|
|
|
|
|
|
|
|
|
rpc_stats_finish();
|
|
|
|
|
|
|
|
|
|
if (use_mempool)
|
|
|
|
|
{
|
|
|
|
|
acl_mem_slice_gc();
|
|
|
|
|
acl_mem_slice_destroy();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|