You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AF_INET6=whendefined(macosx): 30else: 23## for network protocol IPv6.
Domains are platform-specific and do not form a closed set - when you read a domain from the list of addresses that any wrapped C api supports, you may get values that nim does not support which breaks the enum invariant meaning that using an enum for Domain constrains the native socket support to whatever nim happens to have supported at the time of inception whereas native sockets are more flexible - an enum domain could perhaps be suitable for some high-level library that only offers limited socket support (ie tcp/udp).
A better design would model domains etc as distinct open integers as they are represented in the underlying interface.
Even if the enum design is kept, the enum values should never be used to interface with the system - therefore, assigning random values like 23 and creating a holey enum serves no purpose - ie on linux, AF_INET6 has the value 10.
Nim Version
2.0
Current Output
No response
Expected Output
No response
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Description
Nim/lib/pure/nativesockets.nim
Line 70 in 3be2514
Domains are platform-specific and do not form a closed set - when you read a domain from the list of addresses that any wrapped C api supports, you may get values that nim does not support which breaks the
enum
invariant meaning that using an enum forDomain
constrains the native socket support to whatever nim happens to have supported at the time of inception whereas native sockets are more flexible - anenum
domain could perhaps be suitable for some high-level library that only offers limited socket support (ie tcp/udp).A better design would model domains etc as distinct open integers as they are represented in the underlying interface.
Even if the enum design is kept, the enum values should never be used to interface with the system - therefore, assigning random values like
23
and creating a holey enum serves no purpose - ie on linux, AF_INET6 has the value 10.Nim Version
2.0
Current Output
No response
Expected Output
No response
Possible Solution
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: