-
-
Notifications
You must be signed in to change notification settings - Fork 143
Closed
Description
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()
`
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels