We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 717f009 commit d064a90Copy full SHA for d064a90
pytcp/socket/__init__.py
@@ -76,6 +76,7 @@ def socket(
76
77
from pytcp.socket.tcp__socket import TcpSocket
78
from pytcp.socket.udp__socket import UdpSocket
79
+ from pytcp.socket.raw__socket import RawSocket
80
81
match type, protocol:
82
case SocketType.STREAM, None | IpProto.TCP:
@@ -87,8 +88,8 @@ def socket(
87
88
case SocketType.DGRAM, IpProto.ICMP4 | IpProto.ICMP6:
89
raise NotImplementedError
90
- case SocketType.RAW, IpProto.ICMP4 | IpProto.ICMP6:
91
- raise NotImplementedError
+ case SocketType.RAW, _:
92
+ return RawSocket(address_family=family, ip_proto=protocol)
93
94
case _:
95
raise ValueError("Invalid socket type.")
0 commit comments