Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-esp32
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-esp32
Commits
55738068
Unverified
Commit
55738068
authored
Apr 15, 2024
by
Lucas Saavedra Vaz
Committed by
GitHub
Apr 15, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(udp_server): Convert script from Python 2 to 3 (#9513)
parent
05967332
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
libraries/WiFi/examples/WiFiUDPClient/udp_server.py
libraries/WiFi/examples/WiFiUDPClient/udp_server.py
+6
-6
No files found.
libraries/WiFi/examples/WiFiUDPClient/udp_server.py
View file @
55738068
...
...
@@ -6,17 +6,17 @@ import sys
try
:
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
s
.
setsockopt
(
socket
.
SOL_SOCKET
,
socket
.
SO_REUSEADDR
,
1
)
except
socket
.
error
,
msg
:
print
'Failed to create socket. Error Code : '
+
str
(
msg
[
0
])
+
' Message '
+
msg
[
1
]
except
socket
.
error
as
msg
:
print
(
'Failed to create socket. Error Code : '
+
str
(
msg
[
0
])
+
' Message '
+
msg
[
1
])
sys
.
exit
()
try
:
s
.
bind
((
''
,
3333
))
except
socket
.
error
,
msg
:
print
'Bind failed. Error: '
+
str
(
msg
[
0
])
+
': '
+
msg
[
1
]
except
socket
.
error
as
msg
:
print
(
'Bind failed. Error: '
+
str
(
msg
[
0
])
+
': '
+
msg
[
1
])
sys
.
exit
()
print
'Server listening'
print
(
'Server listening'
)
while
1
:
d
=
s
.
recvfrom
(
1024
)
...
...
@@ -25,6 +25,6 @@ while 1:
if
not
data
:
break
print
data
.
strip
(
)
print
(
data
.
strip
()
)
s
.
close
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment