Replies: 2 comments
-
|
I think most of the people just wrap |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thank you for your prompt reply. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
from threading import Thread t = Thread(target=client.listen) t.start()I used the code in the example to implement the function of sending SMS in django, but when listen() throws an exception, the thread terminates and the enquire_link packet loss, it will causes the server unbind.
My uwsgi server threads are set to 4, and 4 threads constantly rebind the server, it will resulting whith similar errors like: smpplib. exceptions. UnknownCommand Error: Unknown SMPP command code "0x428"
So,would the following modifications be better?
`
def listen():
while True:
try:
ecarxsmpp.client.listen()
except Exception:
print traceback.format_exc()
t = Thread(target=listen)
t.start()
`
Beta Was this translation helpful? Give feedback.
All reactions