37
37
_global_socketpool = {}
38
38
39
39
40
- class SocketPoolContants : # pylint: disable=too-few-public-methods
41
- """Helper class for the constants that are needed everywhere """
40
+ class SocketPool :
41
+ """WIZNET5K SocketPool library """
42
42
43
- # These must match circuitpython "socketpoool " values. However, we cannot
43
+ # These must match circuitpython "socketpool " values. However, we cannot
44
44
# depend on socketpool being importable, so hard-code them here.
45
45
SOCK_STREAM = 1
46
46
SOCK_DGRAM = 2
@@ -50,10 +50,6 @@ class SocketPoolContants: # pylint: disable=too-few-public-methods
50
50
51
51
AF_INET = const (3 )
52
52
53
-
54
- class SocketPool (SocketPoolContants ):
55
- """WIZNET5K SocketPool library"""
56
-
57
53
def __new__ (cls , iface : WIZNET5K ):
58
54
# We want to make sure to return the same pool for the same interface
59
55
if iface not in _global_socketpool :
@@ -191,7 +187,7 @@ def getaddrinfo( # pylint: disable=redefined-builtin,too-many-arguments,unused-
191
187
raise ValueError ("Port must be an integer" )
192
188
if not self ._is_ipv4_string (host ):
193
189
host = self .gethostbyname (host )
194
- return [(SocketPoolContants .AF_INET , type , proto , "" , (host , port ))]
190
+ return [(SocketPool .AF_INET , type , proto , "" , (host , port ))]
195
191
196
192
def gethostbyname (self , hostname : str ) -> str :
197
193
"""
@@ -210,8 +206,8 @@ def gethostbyname(self, hostname: str) -> str:
210
206
211
207
def socket ( # pylint: disable=redefined-builtin
212
208
self ,
213
- family : int = SocketPoolContants . AF_INET ,
214
- type : int = SocketPoolContants . SOCK_STREAM ,
209
+ family : int = AF_INET ,
210
+ type : int = SOCK_STREAM ,
215
211
proto : int = 0 ,
216
212
fileno : Optional [int ] = None ,
217
213
):
0 commit comments