Closed mib1185 closed 3 weeks ago
Hi @mib1185, looks good to me. However, there was a missing import statement, which caused some tests to fail. I have fixed this issue, and the changes are now available in version 2.7.1.
Hi @M0r13n yeah I already recognized my fault (see https://github.com/M0r13n/pyais/commit/59e223044de72bde5e0e412257043f8b0866e598#r145478945) :see_no_evil: Thanks for reviewing and merging this :slightly_smiling_face:
Hey @mib1185,
There was another issue with your PR. It causes an import error on Windows because the socket option for reusable sockets isn't available on that platform. Due to this, I decided to partially revert your changes. You can still set the socket options after creating a streaming instance (the socket attribute is public). I also yanked the faulty release from PyPI.
Hi @M0r13n thanks for informing me about this! OK, than I'll try to set these options afterwards direct in the socket property 👍
This will expose the
self._fobj.close()
asclose()
method, so we can close the stream even without running in a context manager. Further the udp listener socket can be set to be reusable, which helps in case of a fast close and reopen (reuse) of the same listener socket - eq. when the application restarts.