该版本会为 onConnect、onReceive、onPacket 等回调函数,默认开启协程并发回调。
参见源码:
https://github.com/swoole/swoole-src/blob/v4.0.0/swoole_server.c#L884
https://github.com/swoole/swoole-src/blob/v4.0.0/swoole_server.c#L990
diff --git a/src/network/ReactorThread.c b/src/network/ReactorThread.c | |
index e3aac4f5..a9617ff3 100644 | |
--- a/src/network/ReactorThread.c | |
+++ b/src/network/ReactorThread.c | |
@@ -197,14 +197,14 @@ static int swReactorThread_onPackage(swReactor *reactor, swEvent *event) | |
{ | |
pkt.port = ntohs(info.addr.inet_v4.sin_port); | |
pkt.addr.v4.s_addr = info.addr.inet_v4.sin_addr.s_addr; | |
- task.data.info.fd = pkt.addr.v4.s_addr; | |
+ task.data.info.fd = pkt.port; |
<?php | |
// DEFINE our cipher | |
define('AES_256_CBC', 'aes-256-cbc'); | |
// Generate a 256-bit encryption key | |
// This should be stored somewhere instead of recreating it each time | |
$encryption_key = openssl_random_pseudo_bytes(32); | |
// Generate an initialization vector | |
// This *MUST* be available for decryption as well |
curl --include \ | |
--no-buffer \ | |
--header "Connection: Upgrade" \ | |
--header "Upgrade: websocket" \ | |
--header "Host: example.com:80" \ | |
--header "Origin: http://example.com:80" \ | |
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \ | |
--header "Sec-WebSocket-Version: 13" \ | |
http://example.com:80/ |
该版本会为 onConnect、onReceive、onPacket 等回调函数,默认开启协程并发回调。
参见源码:
https://github.com/swoole/swoole-src/blob/v4.0.0/swoole_server.c#L884
https://github.com/swoole/swoole-src/blob/v4.0.0/swoole_server.c#L990
/***************************************************************************** | |
* QuantCup 1: Price-Time Matching Engine | |
* | |
* Submitted by: voyager | |
* | |
* Design Overview: | |
* In this implementation, the limit order book is represented using | |
* a flat linear array (pricePoints), indexed by the numeric price value. | |
* Each entry in this array corresponds to a specific price point and holds | |
* an instance of struct pricePoint. This data structure maintains a list |
#!/usr/bin/env bash | |
#Copyright (C) 2018 Eagle <[email protected]> | |
ES_HOST="http://127.0.0.1:9200" | |
SEVEN_DAYS_AGO=$(date -d "-7 day" +%Y.%m.%d) | |
THREE_DAYS_AGO=$(date -d "-3 day" +%Y.%m.%d) | |
declare -a INDEX_FOR_SEVEN=( | |
"filebeat-xxx-" |
#!/bin/bash | |
# | |
# A script to enable TCP BBR on a Linux system. | |
# | |
# @author Dumitru Uzun (DUzun.Me) | |
# @version 1.0.0 | |
# @distro ArchLinux/Manjaro | |
# | |
old_cc=`sysctl net.ipv4.tcp_congestion_control | awk -F= '{print $2}' | sed -e s/\^\\s//` |
/* laravel extension for PHP */ | |
#ifdef HAVE_CONFIG_H | |
# include "config.h" | |
#endif | |
#include "php.h" | |
#include "ext/standard/info.h" | |
#include "php_laravel.h" |