Skip to content

Commit 4967611

Browse files
committed
Create sockets via fallible constructors
1 parent d1306ce commit 4967611

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

wit-0.3.0-draft/types.wit

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ interface types {
152152
/// - <https://man7.org/linux/man-pages/man2/socket.2.html>
153153
/// - <https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketw>
154154
/// - <https://man.freebsd.org/cgi/man.cgi?query=socket&sektion=2>
155-
@since(version = 0.3.0-rc-2025-08-15)
155+
constructor(address-family: ip-address-family) -> result<tcp-socket, error-code>;
156156
create: static func(address-family: ip-address-family) -> result<tcp-socket, error-code>;
157157

158158
/// Bind the socket to the provided IP address and port.
@@ -511,8 +511,7 @@ interface types {
511511
/// - <https://man7.org/linux/man-pages/man2/socket.2.html>
512512
/// - <https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketw>
513513
/// - <https://man.freebsd.org/cgi/man.cgi?query=socket&sektion=2>
514-
@since(version = 0.3.0-rc-2025-08-15)
515-
create: static func(address-family: ip-address-family) -> result<udp-socket, error-code>;
514+
constructor(address-family: ip-address-family) -> result<udp-socket, error-code>;
516515

517516
/// Bind the socket to the provided IP address and port.
518517
///

0 commit comments

Comments
 (0)