質問編集履歴
2
コードを更新
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
web-soket通信のモジュールを使ったプログラムを作っていて、動作自体は問題なく動いているのですが、10回に1回程度、以下の例外が発生します。
|
2
2
|
|
3
3
|
|
4
|
+
|
5
|
+
```python
|
4
6
|
|
5
7
|
import sys
|
6
8
|
|
@@ -51,6 +53,8 @@
|
|
51
53
|
print("ERR2")
|
52
54
|
|
53
55
|
|
56
|
+
|
57
|
+
```
|
54
58
|
|
55
59
|
|
56
60
|
|
1
コードと出力結果を追加しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,12 +1,136 @@
|
|
1
1
|
web-soket通信のモジュールを使ったプログラムを作っていて、動作自体は問題なく動いているのですが、10回に1回程度、以下の例外が発生します。
|
2
2
|
|
3
3
|
|
4
|
+
|
5
|
+
import sys
|
6
|
+
|
7
|
+
import time
|
8
|
+
|
9
|
+
from obswebsocket import obsws, requests
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
host = "localhost"
|
14
|
+
|
15
|
+
port = 4444
|
16
|
+
|
17
|
+
password = "secret"
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
args = sys.argv
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
try:
|
26
|
+
|
27
|
+
ws = obsws(host, port, password)
|
28
|
+
|
29
|
+
ws.connect()
|
30
|
+
|
31
|
+
except:
|
32
|
+
|
33
|
+
print("ERR1")
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
time.sleep(1)
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
print(args[1])
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
try:
|
46
|
+
|
47
|
+
ws.disconnect()
|
48
|
+
|
49
|
+
except:
|
50
|
+
|
51
|
+
print("ERR2")
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
C:\Users\XXXX\Desktop\000>python test2.py 004
|
58
|
+
|
59
|
+
004
|
4
60
|
|
5
61
|
Exception in thread Thread-1:
|
6
62
|
|
7
63
|
Traceback (most recent call last):
|
8
64
|
|
9
|
-
File "C:\Program Files\Python37\lib\threading.py", line 926, in _bootstrap_
|
65
|
+
File "C:\Program Files\Python37\lib\threading.py", line 926, in _bootstrap_in
|
66
|
+
|
67
|
+
er
|
68
|
+
|
69
|
+
self.run()
|
70
|
+
|
71
|
+
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\obswebsoc
|
72
|
+
|
73
|
+
et\core.py", line 201, in run
|
74
|
+
|
75
|
+
message = self.ws.recv()
|
76
|
+
|
77
|
+
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\websocket
|
78
|
+
|
79
|
+
_core.py", line 313, in recv
|
80
|
+
|
81
|
+
opcode, data = self.recv_data()
|
82
|
+
|
83
|
+
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\websocket
|
84
|
+
|
85
|
+
_core.py", line 330, in recv_data
|
86
|
+
|
87
|
+
opcode, frame = self.recv_data_frame(control_frame)
|
88
|
+
|
89
|
+
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\websocket
|
90
|
+
|
91
|
+
_core.py", line 357, in recv_data_frame
|
92
|
+
|
93
|
+
self.send_close()
|
94
|
+
|
95
|
+
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\websocket
|
96
|
+
|
97
|
+
_core.py", line 390, in send_close
|
98
|
+
|
99
|
+
self.send(struct.pack('!H', status) + reason, ABNF.OPCODE_CLOSE)
|
100
|
+
|
101
|
+
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\websocket
|
102
|
+
|
103
|
+
_core.py", line 253, in send
|
104
|
+
|
105
|
+
return self.send_frame(frame)
|
106
|
+
|
107
|
+
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\websocket
|
108
|
+
|
109
|
+
_core.py", line 278, in send_frame
|
110
|
+
|
111
|
+
l = self._send(data)
|
112
|
+
|
113
|
+
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\websocket
|
114
|
+
|
115
|
+
_core.py", line 448, in _send
|
116
|
+
|
117
|
+
return send(self.sock, data)
|
118
|
+
|
119
|
+
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\websocket
|
120
|
+
|
121
|
+
_socket.py", line 157, in send
|
122
|
+
|
123
|
+
return _send()
|
124
|
+
|
125
|
+
File "C:\Users\XXXX\AppData\Roaming\Python\Python37\site-packages\websocket
|
126
|
+
|
127
|
+
_socket.py", line 139, in _send
|
128
|
+
|
129
|
+
return sock.send(data)
|
130
|
+
|
131
|
+
OSError: [WinError 10038] ソケット以外のものに対して操作を実行しようとしました。
|
132
|
+
|
133
|
+
|
10
134
|
|
11
135
|
|
12
136
|
|