alibaba / alibaba/tidevice

通过threading.thread启动监控运行中报错:ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2423)

Open
#121 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
2.6k
Forks
469
PR merge metrics
No merged PRs in 30d

Description

首先感谢大神!
现在有一个问题就是 我想写一个可以同时监控多台ios设备的程序,所以就想到了用threading.Thread方法
这是开启方法:
def performance_switch_on(self, package):
self.package = package
self.device_performance.start(self.package, callback=self.callback)
while self.switch:
time.sleep(5)

在运行(threading.Thread(target=performance_switch_on, args=(package, )).start()
得时候遇到如下的报错:
Exception in thread Thread-7:
Traceback (most recent call last):
File "C:\Python3\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "C:\Python3\lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "C:\Python3\lib\site-packages\tidevice\_instruments.py", line 560, in _drain
self._drain_single_message()
File "C:\Python3\lib\site-packages\tidevice\_instruments.py", line 611, in _drain_single_message
self._reply_null(dtxm)
File "C:\Python3\lib\site-packages\tidevice\_instruments.py", line 518, in _reply_null
message_id=m.message_id)
File "C:\Python3\lib\site-packages\tidevice\_instruments.py", line 392, in send_dtx_message
self.sendall(data)
File "C:\Python3\lib\site-packages\tidevice\_safe_socket.py", line 66, in sendall
return self._sock.sendall(data)
File "C:\Python3\lib\ssl.py", line 1034, in sendall
v = self.send(byte_view[count:])
File "C:\Python3\lib\ssl.py", line 1003, in send
return self._sslobj.write(data)
ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2423)

有什么比较好的解决方法呢?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reported failure path in tidevice/_instruments.py, especially _drain, _drain_single_message, _reply_null, and send_dtx_message, then inspect tidevice/_safe_socket.py and Python's SSL sendall behavior. Reproduce performance monitoring for multiple iOS devices using threading. Done means the concurrent monitoring scenario no longer produces the reported SSLEOFError, or the issue documents a confirmed limitation and handling path.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, python
Domain
devtools, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.