Strange behavior when receiving multiple tcp messages at the time #4465
Answered
by
LAGGOUNE-Walid
LAGGOUNE-Walid
asked this question in
Q&A
-
Hello everyone, i am using a simple swoole TCP server. And this is my php tcp client code : $i = 0;
$start = microtime(true);
while($i <= 100) {
socket_write($sock, "hi");
$i++;
}
echo "Seneded ".$i." \n";
socket_close($sock); On my server side $server->on('Receive', function ($server, $fd, $fromId, $data) use ($self) {
echo "Data: ".$data."\n";
}); i thought that the server will print the data like this
But the server printed the data like this:
What can i do to solve this ? |
Beta Was this translation helpful? Give feedback.
Answered by
LAGGOUNE-Walid
Nov 3, 2021
Replies: 1 comment
-
I tries this solution |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
LAGGOUNE-Walid
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
I tries this solution
https://www.programmerall.com/article/6844194502/