-
When a swoole client receives a message from the server, the two are merged into one.
the following is the log of the client on the server
ConfigInit demo ...
config server judge
ConfigInit -> init
get_swoole_client
pms_config:9502
ConfigInit -> init end
Receive: s:22:"!";
Receive: s:6:"wocao!";
Confi...
-
What is the problem of deploying websocket built by swoole to docker?
the php project is deployed on docker. The master node returns the websocket server built by Swoole at port 10028 and listens on port 9502. The client failed to connect using IP plus port 9502. How to solve this problem ...
-
Why do swoole use implicit collaborations now? Instead of yield-style collaboration?
one of the main advantages of co-programming over multithreading is that it actively gives up CPU, rather than CPU preemption. in this way, many locks can be avoided in order to avoid preemptive locks.
but swoole chooses implicit co-programs, so that...
-
The server host of swoole can bind domain name, but it is not the effect of virtual host like apache or nginx. How to solve this problem?
new a server code in swoole is as follows:
$serv = new swoole_server( 127.0.0.1 , 9501);
now I want to create a HTTP server. I need to bind two domain names (www.a.com and www.b.com). After testing, the code is as follows
$serv = new swoole_server(...
-
The onClose event cannot be triggered by the direct disconnection of swoole websocket.
php: 7.0.29 swoole: 2.1.3 linux: ubuntu16.04 swoole Startup Settings daemonize = > 0, worker_num = > 2
I use a Mini Program websocket.. Under normal circumstances, Mini Program shuts down can trigger onClose events. but if I disconnect wif...
-
Swoole development game server
now I m going to use swoole to develop the game server. I don t consider other languages for the time being, because the company is not familiar with other languages, and the project deadline is coming soon what I want to ask is, for example, when de...
-
When swoole asynchronous mysql acquires big data, it simply exits and no data is returned.
simply use the asynchronous mysql client of swoole to obtain 100000 data. After spending a long period of time in php7 in one environment, you can execute the callback method of query to output data, but in the php5.4 of another environment, you do not...
-
Swoft framework, what is the relationship between the four installation methods?
download projects during manual installation and composer installation, just choose one at random. What did docker installation and docker-compose installation do later? Please explain, thank you!
...
-
How to use swoole_table instead of redis as a shared cache
I took a look, first create a swoole_server, and then bind the swoole_table to it
feels more troublesome than redis
...
-
After the swoole server has not communicated for a long time, when the client connects again, the client cannot connect. You need to kill the process and then open it again.
after the swoole server has not communicated for a long time, when the client connects again, the process needs to be kill off and then reopened. What is the reason for this? ...
-
Ask how to use hiredis under swoole
The asynchronous redis client in the swoole document reads as follows:
< H1 > swoole_redis- > _ _ call < H1 >
Magic method, the method name is mapped to the Redis instruction, and the parameter is used as the parameter of the Redis instruction.
$re...
-
Centos7 executes PHP-m error after installing swoole extension
Unable to load dynamic library usr lib64 php modules swoole.so (tried: usr lib64 php modules swoole.so ( usr lib64 php modules swoole.so: undefined symbol: mysqlnd_find_charset_nr)
when editing and installing swoole4, neither the, make test no...
-
Swoole compilation error prompts unknown type name 'swBuffer_trunk'
error compiling Swoole
compile command:
. configure
--with-php-config= Applications MAMP bin php php5.6.30 bin php-config
--enable-coroutine
--enable-openssl
--enable-http2
--enable-async-redis
--enable-sockets
--enable-mysqlnd...
-
Why does the traversal of swoole_table need PCRE as a regular expression library?
php implements iterator only needs functions such as spl_iterators and next key current. In terms of source code,
-sharpifdef HAVE_PCRE
-sharpinclude <ext spl spl_iterators.h>
-sharpendif
-sharpifdef HAVE_PCRE
static PHP_METHOD(swoole_table, rew...
-
Questions about real-time communication on the web (swoole/websocket)
in the IM system, is it pulled through ajax or obtained through websocket to get chat records, contact lists and message lists? or is it just real-time communication using websocket protocol in the session, and other scenarios directly use ajax;;
I a...
-
On the question of how to get request-id in swoole?
A unique id: requestid is generated after receiving a request; this id is recorded as a prefix when logging later. Later, by locating the problem, you can easily get all the logs of this request through requestid .
in fpm run mode, you can save ...
-
Swoole reload doesn't work?
swoole restart does not take effect Test procedure: 1. Output a string 2 in the open callback method. Then modify the output string after startup. 3. The kill-USR1 PID with $server- > reload and the official website will not take effect, and the outp...
-
How does swoole proactively push messages to clients?
there is $serv in the callback function of swoole, such as onOpen onMessage, but what if you want to push a message to the client somewhere else?
used to use $serv- > push ($fd,$data);
but how to solve this if serv doesn t exist anywhere else?
...
-
Centos7 reported an error when installing Swool: php.h: No such file or directory
wrong in make Times
...
-
Docker nginx swoole reverse proxy
I, a docker running nginx and a docker running php7.2 I ran the swoole websocket service in php72 docker. I can work through 127.0.0.1 br 9501 but when I configure proxy 9501 in nginx.conf, as long as I am a proxy nginx, I will hang up whether I am a p...