kopia lustrzana https://github.com/micropython/micropython-lib
socket: Return partially decoded peer address from .accept().
Full decoding requires implementing socket.inet_ntop().pull/65/merge
rodzic
6f7bed1c53
commit
f1533338ea
|
@ -36,6 +36,12 @@ def create_connection(addr, timeout=None, source_address=None):
|
|||
|
||||
class socket(_socket.socket):
|
||||
|
||||
def accept(self):
|
||||
s, addr = super().accept()
|
||||
addr = _socket.sockaddr(addr)
|
||||
# Assumes IPv4
|
||||
return (s, addr[1:3])
|
||||
|
||||
def bind(self, addr):
|
||||
return super().bind(_resolve_addr(addr))
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue