FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add ThreadSafeClient implementation by PaulWasTaken · Pull Request #203 · python-smpplib/python-smpplib · GitHub

Add ThreadSafeClient implementation - #203

Open
PaulWasTaken wants to merge 3 commits into
python-smpplib:masterfrom
PaulWasTaken:feature/thread-safe-client
Open

Add ThreadSafeClient implementation#203
PaulWasTaken wants to merge 3 commits into
python-smpplib:masterfrom
PaulWasTaken:feature/thread-safe-client

Conversation

Copy link
Copy Markdown

I based it on #187.
Hope nobody minds)

PaulWasTaken force-pushed the feature/thread-safe-client branch from 097d6f3 to 8faa88f Compare July 11, 2022 08:45
Comment thread smpplib/client.py Outdated

m4rtinpf left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Awesome idea!

Built something with this library a while back and had some issues with it being thread-unsafe.

Comment thread smpplib/client.py Outdated
Comment thread smpplib/client.py Outdated
Comment thread smpplib/client.py
def send_pdu(self, pdu, send_later=False) -> bool:
if send_later:
self._send_queue.append(pdu)
self._send_sock.send(b'\x00')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Why are we sending a 00? Is it a no-op? If so, why are we sending it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

It is some sort of notification frame. We put it into the send socket to wake up our read socket

Comment thread smpplib/client.py Outdated
PaulWasTaken force-pushed the feature/thread-safe-client branch from 3600d48 to 455c19d Compare April 25, 2023 14:04

Copy link
Copy Markdown
Author

@eigenein FYI

Comment thread smpplib/client.py

if not rlist:
if self._should_prolong_session():
if not auto_send_enquire_link:

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

TODO: check auto_send_enquire_link before self._should_prolong_session() call

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL