customer server connection server shows that the connection is successful, but one of the functions reports an error socket_read (): unable to read from socket [10060]
the code is as follows
<?php
header("Content-Type: text/html; charset=gb2312");
//socket
$socket = socket_create(AF_INET,SOCK_STREAM,SOL_TCP);
//
if(socket_connect($socket,"192.168.1.4",6002) == false){
echo "connect fail massege:".socket_strerror(socket_last_error());
}else{
$message = "ttt";
$message = mb_convert_encoding($message,"GBK","UTF-8");
//
if(socket_write($socket,$message,strlen($message)) == false){
echo "fail to write".socket_strerror(socket_last_error());
}else{
echo "client write success".PHP_EOL;
//
while($callback = socket_read($socket,102400)){
//socket_getpeername($new_socket, $addr, $port);
echo "server return message is:".PHP_EOL.$callback;
}
echo socket_strerror(socket_last_error());
}
}
socket_close($socket);//
No reason found