Workerman? ???? ??? TCP ??? ??? ???
Workerman? ?? ??? TCP ??? ??? ?? ?????. ?? Workerman? ????? ??????. ????? ???? ?? ??? ? ????. ?????? Workerman/Workerman
? ?????. ?? ?? ? PHP ??? ???? (? : server.php
). ?? ??? ?? 2345?? ?? ?? TCP ??? ?????. '/vendor/autoload.php'; Workerman \ Worker? ??????. $ Worker = New Worker ( "tcp : //0.0.0.0 : 2345"); $ worker- & gt; onconnect = function ($ connection) {echo & quot; {$ connection- & gt; getRemoteip ()}?? ??? ??; }; $ worker- & gt; onmessage = function ($ connection, $ data) {// ???? ?????? ?? $ connection- & gt; send ($ data); }; $ worker- & gt; onclose = function ($ connection) {echo & quot; connection ?? : {$ connection- & gt; getRemoteip ()} : {$ connection- & gt; getRemotePort ()} \ & quot ;; }; Worker :: Runall ();
? ??? workerman \ worker
???? ???? TCP ???? ????. tcp : //0.0.0.0 : 2345
?? ??? ??? ?????. onconnect
, onmessage
? onclose
??? ?? ?? ???, ???? ??? ? ?? ???? ?????. worker :: runall ()
??? ?????. php server.php>.
Workerman? ?? TCP ????? ??? ??? ?? ? ? ???????
?, Workerman? ?? TCP ????? ??? ??? ????? ???????. ?? ???? ?? ?? ??? ?? (??? ?? ??)? ???? ??? ?? ??? ????? ?????. ? ?? ??? ??? ???? ??? ??? ????? ????. ??? ????? ???? ???? Workerman? ?? ??? ???? ?? ?? ?? ( onconnect>, <code> onmessage
?)? ??????. ?? ?? ?? ???? ?? ?????? ?? ? ? ??????. ?? ? ??? ?? ?? ?? ??? ??? (CPU, ???, ???? ???)? ?? ????. Workerman? ?? ??? ?? ?? ??? ????? ?? ??? ???? ?? ??? ? ????.
Workerman TCP ??? ?? ?? ??? ??????
Workerman? TCP ??? ??? ?????? ?? ?? ??? ?????. ??? ????? ???
?? ?? ?????. ? ?? ?? ??? ??? ????.
-
???-& gt; count
: ??? ???? ?? ?????. ? ??? ??? ? ?? ?????? ?? ??? ???? ? ??? ?? ?? ????? ???? ???? ?? ? ????. ???? ????? 1???. -
???-& gt; name : -
???-& gt; ???
-
worker- & gt; ?? : ?? ?? ???? (? : 'TCP', 'UDP')? ?????. ???? 'TCP'???. -
Worker- & gt; ssl
:
server.php
?? ??? ?? ??? ??? ??? ? ????. ? :
<code class="php"> $ Worker = new Worker ( "tcp : //0.0.0.0 : 2345 & quot;); $ Worker- & gt; count = 4; // 4 ??? ???? ?? $ Worker- & gt; name = "mytcpserver & quot;; // ... ?? ?? ... </code>
Workerman TCP ??? ???? ???? ????? ??? ??????
???? ??? ???? ?? $ connection
??? ?? onmessage
??? ?? ?????. ??? onmessage
??? $ data
?? ??? ?? ???? ?????. ?????? ?? ???? ???? $ connection- & gt; send ()
???? ??????.
??? ?? :
onmessage
???? ?????????? ???? ?????. ??? ??? ???? ?? ? ? ??????. ? :
<code class="php"> $ worker- & gt; onmessage = function ($ connection, $ data) {$ leadeData = trim ($ data); // ??/??? ? ???? echo & quot; ?? : "; . $ receptData. "\ n" // ?? ? ???? ????? ... $ response = "?? ?? :"; . $ leadeData; $ connection- & gt; send ($ ??); }; </code>
??? ??? :
?????? ?? ???? ???? $ connection- & gt; send ()
??? :
<code class="php"> $ worker- & gt; onmessage = connection ($ connection, $ data) {// ... Process Data) {// $ connection- & gt; send ( "???? Hello!"; }; </code>
?? ??? ??? ?? (? : ?? ??)? ???? ???????. ?? Workerman TCP ?? ??? ???? ??? ?????? ?? ??? ??? ?????. ?? ??? ??? ???? ??? ?? ?? ??? ?? ??? ??? ? ????.
? ??? Workerman? ???? ??? TCP ??? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

??? ??









