Answer the question
In order to leave comments, you need to log in
How to catch an exception from the fwrite command?
There is a Yii2 console application.
public function actionIndex()
{
$ip = 'tcp://192.168.5.162';
$port = 10001;
$storage = 'Автоприем';
$this->fp = $this->init_rfid($ip,$port, $storage);
while($this->fp <> 0){
$this->read_rfid($storage);
usleep(1500000);
}
}
$fp = @fsockopen($ip,$port,$errno, $errstr, 10);
if (!$fp) {
print_r("ERROR: $errno - $errstr\n");
$fp = 0;
} else{
...
}
Error: fwrite(): send of 180 bytes failed with errno=10054
Answer the question
In order to leave comments, you need to log in
this function does not throw exceptions.
How to catch
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question