mirror of
https://github.com/licsber/micropython.git
synced 2024-09-20 09:00:23 +08:00
examples/http_client*: Be sure to close socket.
Otherwise, on bare-metal/RTOS systems can lead to resource leaks.
This commit is contained in:
parent
a53e0e59f3
commit
614deb82c7
@ -24,5 +24,7 @@ def main(use_stream=False):
|
|||||||
s.send(b"GET / HTTP/1.0\n\n")
|
s.send(b"GET / HTTP/1.0\n\n")
|
||||||
print(s.recv(4096))
|
print(s.recv(4096))
|
||||||
|
|
||||||
|
s.close()
|
||||||
|
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
@ -32,5 +32,7 @@ def main(use_stream=True):
|
|||||||
s.send(b"GET / HTTP/1.0\n\n")
|
s.send(b"GET / HTTP/1.0\n\n")
|
||||||
print(s.recv(4096))
|
print(s.recv(4096))
|
||||||
|
|
||||||
|
s.close()
|
||||||
|
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user