断线重连怎么做?
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- python
- Domain
- networking
Research direction
The issue only shows a WebSocketClient example using connect(), run_forever(), opened(), and closed(). Start by reviewing those entry points and the library's client implementation; the issue does not name a file or test. A useful completion criterion would require the desired reconnection behavior and affected API to be specified first.
Written by the indexing model from the issue text.
Description
from ws4py.client.threadedclient import WebSocketClient
from ws4py.exc import HandshakeError
class DummyClient(WebSocketClient):
def opened(self):
self.send(input('请输入你想说的话:'))
def closed(self, code, reason=None):
#print("Closed down", code, reason)
print("Closed down")
def received_message(self, m):
print (m)
if name == 'main':
try:
ws = DummyClient('ws://'+input('请输入ws地址连接:'), protocols=['chat'])
ws.connect()
ws.run_forever()
except KeyboardInterrupt:
ws.close()
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 285
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Lawouach/WebSocket-for-Python
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Lawouach/WebSocket-for-Python#300 ·
-
question
Lawouach/WebSocket-for-Python#297 · 2 comments · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
Lawouach/WebSocket-for-Python#296 ·
-
Lawouach/WebSocket-for-Python#280 · 1 comment · 1 assignee ·
-
Setup new CI Open
Lawouach/WebSocket-for-Python#275 · 1 assignee ·
All issues in Lawouach/WebSocket-for-Python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100