Skip to content

socket.connect(): Auto-select UDP_MODE #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
socket.connect(): Auto-select UDP_MODE
This improves compatibility with the standard socket module
  • Loading branch information
jepler committed May 6, 2024
commit 40b51dafcb982c72c2733c8f99132ea820be48d6
6 changes: 5 additions & 1 deletion adafruit_esp32spi/adafruit_esp32spi_socketpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ def connect(self, address, conntype=None):
depending on the underlying interface"""
host, port = address
if conntype is None:
conntype = self._interface.TCP_MODE
conntype = (
self._interface.UDP_MODE
if self._type == SocketPool.SOCK_DGRAM
else self._interface.TCP_MODE
)
if not self._interface.socket_connect(
self._socknum, host, port, conn_mode=conntype
):
Expand Down