lkeme / BiliHelper-personal

哔哩哔哩(Bilibili)助手 - PHP 版(Personal)
MIT License
992 stars 241 forks source link

运行的时候不时会有这几行白字 #62

Closed wuan11 closed 3 years ago

wuan11 commented 3 years ago

[2021-03-17 21:47:18] BH.WARNING: Socket error: [] [16] [] [] PHP Warning: socket_recv(): unable to read from socket [10054]: Զǿȹرһе��ӡ in E:\BiliHelper-personal-master\src\plugin\ZoneTcpClient.php on line 509

Warning: socket_recv(): unable to read from socket [10054]: Զǿȹرһе��ӡ in E:\BiliHelper-personal-master\src\plugin\ZoneTcpClient.php on line 509

fgggid commented 3 years ago

It might be caused by socket timeout, you can try add below codes after line 504 of ZoneTcpClient.php

image

This should be a bug here, in timeout case, if not reset the read fd set, the loop is useless.

wuan11 commented 3 years ago

It might be caused by socket timeout, you can try add below codes after line 504 of ZoneTcpClient.php

image

This should be a bug here, in timeout case, if not reset the read fd set, the loop is useless.

修改后又出现:PHP Warning: socket_recv(): unable to read from socket [10053]: еֹһѽ����ӡ in E:\BiliHelper-personal-master\src\plugin\ZoneTcpClient.php on line 511

Warning: socket_recv(): unable to read from socket [10053]: еֹһѽ����ӡ in E:\BiliHelper-personal-master\src\plugin\ZoneTcpClient.php on line 511

fgggid commented 3 years ago

Hmmm, I search for the error 10054(connection reset by peer) and 10053(Software caused connection abort.). My guess is wrong. The socket itself is closed from server side, so you get 10054. Nothing can be done here, unless reconnect. Any way, it can reconnect by itself, you can just ignore these warnings. Maybe connect too many zones? I use a modified version of ZoneTcpClient.php, only connect one zone, never see such problem, and I use Linux(Ubuntu) not windows. You can have some tries, one by one:

  1. change config: ZONE_SERVER_ADDR=tcp://hw-gz-live-comet-02.chat.bilibili.com:2243/sub
  2. modify the codes, only connect one or two zones(I think the original codes will connect to all areas), to see if it is fine.