mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
add a warning message
This commit is contained in:
@@ -14,11 +14,13 @@
|
|||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
#include "skynet.h"
|
||||||
#include "skynet_socket.h"
|
#include "skynet_socket.h"
|
||||||
|
|
||||||
#define BACKLOG 32
|
#define BACKLOG 32
|
||||||
// 2 ** 12 == 4096
|
// 2 ** 12 == 4096
|
||||||
#define LARGE_PAGE_NODE 12
|
#define LARGE_PAGE_NODE 12
|
||||||
|
#define POOL_SIZE_WARNING 32
|
||||||
#define BUFFER_LIMIT (256 * 1024)
|
#define BUFFER_LIMIT (256 * 1024)
|
||||||
|
|
||||||
struct buffer_node {
|
struct buffer_node {
|
||||||
@@ -124,6 +126,9 @@ lpushbuffer(lua_State *L) {
|
|||||||
lnewpool(L, size);
|
lnewpool(L, size);
|
||||||
free_node = lua_touserdata(L,-1);
|
free_node = lua_touserdata(L,-1);
|
||||||
lua_rawseti(L, pool_index, tsz+1);
|
lua_rawseti(L, pool_index, tsz+1);
|
||||||
|
if (tsz > POOL_SIZE_WARNING) {
|
||||||
|
skynet_error(NULL, "Too many socket pool (%d)", tsz);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
lua_pushlightuserdata(L, free_node->next);
|
lua_pushlightuserdata(L, free_node->next);
|
||||||
lua_rawseti(L, pool_index, 1); // sb poolt msg size
|
lua_rawseti(L, pool_index, 1); // sb poolt msg size
|
||||||
|
|||||||
Reference in New Issue
Block a user