Esempio n. 1
0
static int
lnodelay(lua_State *L) {
	struct skynet_context * ctx = lua_touserdata(L, lua_upvalueindex(1));
	int id = luaL_checkinteger(L, 1);
	skynet_socket_nodelay(ctx,id);
	return 0;
}
Esempio n. 2
0
// driver.nodelay
// socketdriver.nodelay(fd) socketchannel.lua
static int
lnodelay(lua_State *L) {
	struct skynet_context * ctx = lua_touserdata(L, lua_upvalueindex(1));
	int id = luaL_checkinteger(L, 1);
	// skynet_socket_nodelay	skynet_socket
	// socket_server_nodelay	socket_server
	// send_request 'T'
	// setopt_socket 
	skynet_socket_nodelay(ctx,id);
	return 0;
}
Esempio n. 3
0
int
package_init(struct package * P, struct skynet_context *ctx, const char * param) {
	int n = sscanf(param ? param : "", "%u %d", &P->manager, &P->fd);
	if (n != 2 || P->manager == 0 || P->fd == 0) {
		skynet_error(ctx, "Invalid param [%s]", param);
		return 1;
	}
	skynet_socket_start(ctx, P->fd);
	skynet_socket_nodelay(ctx, P->fd);
	heartbeat(ctx, P);
	skynet_callback(ctx, P, message_handler);

	return 0;
}