Skip to content

Commit

Permalink
fix: partially revert #148 (compat)
Browse files Browse the repository at this point in the history
  • Loading branch information
M0r13n committed Aug 19, 2024
1 parent 3a289b7 commit 6955da4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
====================
pyais CHANGELOG
====================
-------------------------------------------------------------------------------
Version 2.7.2 19 Aug 2024
-------------------------------------------------------------------------------
* removes `reuse` for TCP/UDP sockets
-------------------------------------------------------------------------------
Version 2.7.1 17 Aug 2024
-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyais/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from pyais.tracker import AISTracker, AISTrack

__license__ = 'MIT'
__version__ = '2.7.1'
__version__ = '2.7.2'
__author__ = 'Leon Morten Richter'

__all__ = (
Expand Down
6 changes: 2 additions & 4 deletions pyais/stream.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import typing
import pathlib
from abc import ABC, abstractmethod
from socket import AF_INET, SO_REUSEPORT, SOCK_DGRAM, SOCK_STREAM, SOL_SOCKET, socket
from socket import AF_INET, SOCK_DGRAM, SOCK_STREAM, socket
from typing import BinaryIO, Generator, Generic, Iterable, List, TypeVar, cast

from pyais.exceptions import InvalidNMEAMessageException, NonPrintableCharacterException, UnknownMessageException
Expand Down Expand Up @@ -285,10 +285,8 @@ def read(self) -> Generator[bytes, None, None]:

class UDPReceiver(SocketStream):

def __init__(self, host: str, port: int, preprocessor: typing.Optional[PreprocessorProtocol] = None, reusable: bool = False) -> None:
def __init__(self, host: str, port: int, preprocessor: typing.Optional[PreprocessorProtocol] = None) -> None:
sock: socket = socket(AF_INET, SOCK_DGRAM)
if reusable:
sock.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
sock.bind((host, port))
super().__init__(sock, preprocessor=preprocessor)

Expand Down

0 comments on commit 6955da4

Please sign in to comment.