IOS 推送失败并显示错误消息:fwrite():发送 474 字节失败,errno=10054 现有连接被远程主机强行关闭
IOS Push fails with error message: fwrite(): send of 474 bytes failed with errno=10054 An existing connection was forcibly closed by the remote host
我正在使用开源应用程序 "ProcessMaker"
除 IOS 推送通知外,一切正常,当进行推送的操作时,此推送仅在 IOS 时崩溃(在 android 中正常工作)。
错误:
Warning: stream_socket_client(): SSL: The operation completed successfully. in C:\Bitnami\processmaker-3.0.1.8- 0\apps\processmaker\htdocs\workflow\engine\src\ProcessMaker\BusinessModel\Light\PushMessageIOS.php on line 128
urlssl://gateway.push.apple.com:2195
err0
errstr
fpResource id #146
msg �y33I����1�� Z�^�-+�� �����{"aps":{"alert":"#85 : Travel Request, Request by: \"Jordi Ferri\"","sound":"default","data":{"processId":"14804077157da297c90a955022163281","taskId":"80166625957da297ca43bf6022283253","caseId":"39318847657e115e0176d98020370358","caseTitle":"Travel Request, Request by: \"Jordi Ferri\"","delIndex":"2","typeList":"todo","counters":{"toDo":"0","draft":"0","cancelled":"0","participated":"0","paused":"0","completed":"0","unassigned":0}}}}
len474
Notice: fwrite(): send of 474 bytes failed with errno=10054 An existing connection was forcibly closed by the remote host. in C:\Bitnami\processmaker-3.0.1.8-0\apps\processmaker\htdocs\workflow\engine\src\ProcessMaker\BusinessModel\Light\PushMessageIOS.php on line 147
result0
代码:
foreach ($this->devices as $item) {
// Open a connection to the APNS server
$fp = stream_socket_client($this->url, $err, $errstr, 60, STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT, $ctx);
echo "<br />url" . $this->url;
echo "<br />err" . $err;
echo "<br />errstr" . $errstr;
echo "<br />";
if (!$fp) {
throw (new \Exception(\G::LoadTranslation('ID_FAILED') . ': ' . "$err $errstr"));
} else {
//echo 'Apple service is online. ' . '<br />';
}
// Build the binary notification
$msg = chr(0) . pack('n', 32) . pack('H*', $item) . pack('n', strlen($payload)) . $payload;
// Send it to the server
echo "<br />fp" . $fp;
echo "<br />msg" . $msg;
echo "<br />len" . strlen($msg);
echo "<br />";
$result = fwrite($fp, $msg, strlen($msg));
echo "<br />result" . $result;
}
PHPINFO
可能是因为 APNS 的数据限制只有 256 字节所以请尝试使用简单的消息
此问题已针对 10 月 4 日发布的 processmaker 3.1 修复,如果更新后您仍然看到此问题,请在 http://bugs.processmaker.com/ 上创建一个票证,以便相应地解决。
我正在使用开源应用程序 "ProcessMaker"
除 IOS 推送通知外,一切正常,当进行推送的操作时,此推送仅在 IOS 时崩溃(在 android 中正常工作)。
错误:
Warning: stream_socket_client(): SSL: The operation completed successfully. in C:\Bitnami\processmaker-3.0.1.8- 0\apps\processmaker\htdocs\workflow\engine\src\ProcessMaker\BusinessModel\Light\PushMessageIOS.php on line 128
urlssl://gateway.push.apple.com:2195
err0
errstr
fpResource id #146
msg �y33I����1�� Z�^�-+�� �����{"aps":{"alert":"#85 : Travel Request, Request by: \"Jordi Ferri\"","sound":"default","data":{"processId":"14804077157da297c90a955022163281","taskId":"80166625957da297ca43bf6022283253","caseId":"39318847657e115e0176d98020370358","caseTitle":"Travel Request, Request by: \"Jordi Ferri\"","delIndex":"2","typeList":"todo","counters":{"toDo":"0","draft":"0","cancelled":"0","participated":"0","paused":"0","completed":"0","unassigned":0}}}}
len474
Notice: fwrite(): send of 474 bytes failed with errno=10054 An existing connection was forcibly closed by the remote host. in C:\Bitnami\processmaker-3.0.1.8-0\apps\processmaker\htdocs\workflow\engine\src\ProcessMaker\BusinessModel\Light\PushMessageIOS.php on line 147
result0
代码:
foreach ($this->devices as $item) {
// Open a connection to the APNS server
$fp = stream_socket_client($this->url, $err, $errstr, 60, STREAM_CLIENT_CONNECT | STREAM_CLIENT_PERSISTENT, $ctx);
echo "<br />url" . $this->url;
echo "<br />err" . $err;
echo "<br />errstr" . $errstr;
echo "<br />";
if (!$fp) {
throw (new \Exception(\G::LoadTranslation('ID_FAILED') . ': ' . "$err $errstr"));
} else {
//echo 'Apple service is online. ' . '<br />';
}
// Build the binary notification
$msg = chr(0) . pack('n', 32) . pack('H*', $item) . pack('n', strlen($payload)) . $payload;
// Send it to the server
echo "<br />fp" . $fp;
echo "<br />msg" . $msg;
echo "<br />len" . strlen($msg);
echo "<br />";
$result = fwrite($fp, $msg, strlen($msg));
echo "<br />result" . $result;
}
PHPINFO
可能是因为 APNS 的数据限制只有 256 字节所以请尝试使用简单的消息
此问题已针对 10 月 4 日发布的 processmaker 3.1 修复,如果更新后您仍然看到此问题,请在 http://bugs.processmaker.com/ 上创建一个票证,以便相应地解决。